/* Generated by Cython 0.22 */

#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 < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_22"
#include <stddef.h>
#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 && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
#define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#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_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
  #define Py_TPFLAGS_HAVE_NEWBUFFER 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)
  #define __Pyx_PyFrozenSet_Size(s)         PyObject_Size(s)
#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))
  #define __Pyx_PyFrozenSet_Size(s)         PySet_Size(s)
#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_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_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#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_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#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
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#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
#define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None)
#ifdef __cplusplus
template<typename T>
void __Pyx_call_destructor(T* x) {
    x->~T();
}
template<typename T>
class __Pyx_FakeReference {
  public:
    __Pyx_FakeReference() : ptr(NULL) { }
    __Pyx_FakeReference(T& ref) : ptr(&ref) { }
    T *operator->() { return ptr; }
    operator T&() { return *ptr; }
  private:
    T *ptr;
};
#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;

#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_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(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 (size_t)(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;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        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) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(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_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    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;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    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[] = {
  "pandas/algos.pyx",
  "pandas/src/skiplist.pyx",
  "pandas/src/generated.pyx",
  "pandas/src/join.pyx",
  "pandas/src/datetime.pxd",
  "pandas/src/numpy.pxd",
  "pandas/src/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;
  struct __Pyx_StructField_* fields;
  size_t size;
  size_t arraysize[8];
  int ndim;
  char typegroup;
  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;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_bool_bool_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_bool_object_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_int8_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_int32_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_int64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_float64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_int16_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_int32_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_int64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_float64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int32_int32_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int32_int64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int32_float64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int64_int64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int64_float64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_float32_float32_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_float32_float64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_float64_float64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_object_object_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_bool_bool_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_bool_object_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_int8_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_int32_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_int64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_float64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_int16_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_int32_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_int64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_float64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int32_int32_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int32_int64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int32_float64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int64_int64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int64_float64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_float32_float32_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_float32_float64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_float64_float64_memview;
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_object_object_memview;

/* "pandas/algos.pyx":1470
 * # 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":1598
 * # https://github.com/kwgoodman/bottleneck
 * 
 * cdef struct pairs:             # <<<<<<<<<<<<<<
 *     double value
 *     int death
 */
struct __pyx_t_6pandas_5algos_pairs {
  double value;
  int death;
};

/* "pandas/src/generated.pyx":2709
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_bool_bool_memview(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     uint8_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_bool_bool_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":2810
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_bool_object_memview(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     object[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_bool_object_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":2911
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int8_int8_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int8_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_int8_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":3012
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int8_int32_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_int32_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":3113
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int8_int64_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_int64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":3214
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int8_float64_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_float64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":3315
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int16_int16_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int16_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_int16_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":3416
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int16_int32_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_int32_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":3517
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int16_int64_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_int64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":3618
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int16_float64_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_float64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":3719
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int32_int32_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int32_int32_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":3820
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int32_int64_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int32_int64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":3921
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int32_float64_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int32_float64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":4022
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int64_int64_memview(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int64_int64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":4123
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int64_float64_memview(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int64_float64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":4224
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_float32_float32_memview(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float32_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_float32_float32_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":4325
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_float32_float64_memview(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_float32_float64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":4426
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_float64_float64_memview(float64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_float64_float64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":4527
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_object_object_memview(object[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     object[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_object_object_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":4629
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_bool_bool_memview(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     uint8_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_bool_bool_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":4691
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_bool_object_memview(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     object[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_bool_object_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":4753
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int8_int8_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int8_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_int8_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":4815
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int8_int32_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_int32_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":4877
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int8_int64_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_int64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":4939
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int8_float64_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_float64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":5001
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int16_int16_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int16_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_int16_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":5063
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int16_int32_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_int32_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":5125
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int16_int64_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_int64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":5187
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int16_float64_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_float64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":5249
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int32_int32_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int32_int32_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":5311
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int32_int64_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int32_int64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":5373
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int32_float64_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int32_float64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":5435
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int64_int64_memview(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int64_int64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":5497
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int64_float64_memview(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int64_float64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":5559
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_float32_float32_memview(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float32_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_float32_float32_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":5621
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_float32_float64_memview(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_float32_float64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":5683
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_float64_float64_memview(float64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_float64_float64_memview {
  int __pyx_n;
  PyObject *fill_value;
};

/* "pandas/src/generated.pyx":5745
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_object_object_memview(object[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     object[:, :] out,
 */
struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_object_object_memview {
  int __pyx_n;
  PyObject *fill_value;
};

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

/* --- Runtime support code (head) --- */
#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);
  #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
#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);

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);

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

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

#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

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

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

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

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

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

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

#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);

#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);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

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

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);

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

static void __Pyx_RaiseBufferFallbackError(void);

static void __Pyx_RaiseBufferIndexError(int axis);

#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);
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);

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

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));
}

#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 PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);

static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
                                             int is_tuple, int has_known_size, int decref_tuple);

static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_is_dict);
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
                                              PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);

#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);

#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);

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

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

#include <string.h>

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

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

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

#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_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);

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);

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;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __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);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

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

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);

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);

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 int __Pyx_BytesContains(PyObject* bytes, char character);

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);
static int __pyx_memview_set_nn___pyx_t_5numpy_int8_t(const char *itemp, PyObject *obj);

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);
static int __pyx_memview_set_nn___pyx_t_5numpy_int16_t(const char *itemp, PyObject *obj);

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);
static int __pyx_memview_set_nn___pyx_t_5numpy_int32_t(const char *itemp, PyObject *obj);

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);
static int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj);

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);
static int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj);

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);
static int __pyx_memview_set_nn___pyx_t_5numpy_uint16_t(const char *itemp, PyObject *obj);

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);
static int __pyx_memview_set_nn___pyx_t_5numpy_uint32_t(const char *itemp, PyObject *obj);

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);
static int __pyx_memview_set_nn___pyx_t_5numpy_uint64_t(const char *itemp, PyObject *obj);

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

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

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);
static int __pyx_memview_set_object(const char *itemp, PyObject *obj);

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);

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

static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

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); /* 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); /* 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); /* proto*/
static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
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); /* proto*/
static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* 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 *, int *, int *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *); /*proto*/

/* Module declarations from 'khash' */

/* Module declarations from 'pandas.lib' */
static int (*__pyx_f_6pandas_3lib_is_null_datetimelike)(PyObject *); /*proto*/

/* 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_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 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_object(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_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 PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_bool_bool_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_bool_bool_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_bool_object_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_bool_object_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int8_int8_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_int8_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int8_int32_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_int32_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int8_int64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_int64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int8_float64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_float64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int16_int16_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_int16_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int16_int32_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_int32_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int16_int64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_int64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int16_float64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_float64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int32_int32_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int32_int32_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int32_int64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int32_int64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int32_float64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int32_float64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int64_int64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int64_int64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int64_float64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int64_float64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_float32_float32_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_float32_float32_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_float32_float64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_float32_float64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_float64_float64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_float64_float64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_object_object_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_object_object_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_bool_bool_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_bool_bool_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_bool_object_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_bool_object_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int8_int8_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_int8_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int8_int32_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_int32_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int8_int64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_int64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int8_float64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_float64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int16_int16_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_int16_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int16_int32_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_int32_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int16_int64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_int64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int16_float64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_float64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int32_int32_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int32_int32_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int32_int64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int32_int64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int32_float64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int32_float64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int64_int64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int64_int64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int64_float64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int64_float64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_float32_float32_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_float32_float32_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_float32_float64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_float32_float64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_float64_float64_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_float64_float64_memview *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_object_object_memview(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_object_object_memview *__pyx_optional_args); /*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_AttributeError;
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_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, PyObject *__pyx_v_floor); /* 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_534__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_536__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_538__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_540__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_542__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_544__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_546__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_548__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_550__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_552__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_556__pyx_fuse_0median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_558__pyx_fuse_1median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_560__pyx_fuse_2median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_562__pyx_fuse_3median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_564__pyx_fuse_4median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_566__pyx_fuse_5median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_568__pyx_fuse_6median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_570__pyx_fuse_7median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_572__pyx_fuse_8median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_574__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, int __pyx_v_ignore_na, int __pyx_v_minp); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_28ewmcov(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input_x, PyArrayObject *__pyx_v_input_y, __pyx_t_5numpy_double_t __pyx_v_com, int __pyx_v_adjust, int __pyx_v_ignore_na, int __pyx_v_minp, int __pyx_v_bias); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_30nancorr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mat, PyObject *__pyx_v_cov, PyObject *__pyx_v_minp); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_32nancorr_spearman(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mat, Py_ssize_t __pyx_v_minp); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_34roll_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_36roll_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_38roll_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_40roll_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_42roll_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_44roll_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_46roll_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_48roll_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_50roll_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_52roll_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_54roll_generic(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, int __pyx_v_offset, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_56roll_window(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, PyArrayObject *__pyx_v_weights, int __pyx_v_minp, int __pyx_v_avg); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_58is_lexsorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_60groupby_indices(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_62group_labels(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_64groupsort_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, Py_ssize_t __pyx_v_ngroups); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_66group_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_68group_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_70group_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_72group_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_74group_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_76inner_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_78left_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_80full_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_82_get_result_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sorter, PyObject *__pyx_v_indexer); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_84ffill_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indexer); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_86ffill_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_88ensure_platform_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_90ensure_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_92ensure_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_94ensure_float32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_96ensure_int8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_98ensure_int16(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_100ensure_int32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_102ensure_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_104map_indices_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_106map_indices_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_108map_indices_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_110map_indices_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_112map_indices_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_114map_indices_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_116pad_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_118pad_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_120pad_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_122pad_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_124pad_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_126pad_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_128backfill_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_130backfill_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_132backfill_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_134backfill_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_136backfill_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_138backfill_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_140pad_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_142pad_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_144pad_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_146pad_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_148pad_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_150pad_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_152backfill_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_154backfill_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_156backfill_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_158backfill_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_160backfill_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_162backfill_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_164pad_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_166pad_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_168pad_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_170pad_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_172pad_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_174pad_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_176backfill_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_178backfill_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_180backfill_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_182backfill_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_184backfill_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_186backfill_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_188is_monotonic_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_timelike); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_190is_monotonic_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_timelike); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_192is_monotonic_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_timelike); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_194is_monotonic_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_timelike); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_196is_monotonic_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_timelike); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_198is_monotonic_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_timelike); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_200groupby_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_202groupby_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_204groupby_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_206groupby_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_208groupby_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_210groupby_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_212arrmap_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_214arrmap_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_216arrmap_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_218arrmap_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_220arrmap_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_222arrmap_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_224take_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_226take_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_228take_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_230take_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_232take_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_234take_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_236take_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_238take_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_240take_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_242take_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_244take_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_246take_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_248take_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_250take_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_252take_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_254take_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_256take_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_258take_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_260take_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_262take_2d_axis0_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_bool_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_axis0_object_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_bool_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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_axis1_object_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_338take_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_340take_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_342take_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_344take_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_346take_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_348take_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_350take_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_352take_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_354take_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_356take_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_358take_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_360take_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_362take_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_364take_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_366take_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_368take_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_370take_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_372take_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_374take_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_376diff_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_378diff_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_380diff_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_382diff_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_384diff_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_386diff_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_388group_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_390group_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_392group_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_394group_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_396group_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_398group_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_400group_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_402group_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_404group_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_406group_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_408group_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_410group_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_412group_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_414group_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_416group_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_418group_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_420group_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_422group_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_424group_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_426group_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_428group_last_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_430group_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_432group_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_434group_last_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_436group_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_438group_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_440group_nth_int64(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_442group_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_444group_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_446group_nth_bin_int64(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_448group_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_450group_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_452group_min_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_454group_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_456group_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_458group_min_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_460group_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_462group_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_464group_max_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_466group_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_468group_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_470group_max_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_472group_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_474group_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_476group_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_478group_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_480group_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_482group_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_484group_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_486group_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_488group_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_490group_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_492left_join_indexer_unique_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_494left_join_indexer_unique_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_496left_join_indexer_unique_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_498left_join_indexer_unique_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_500left_join_indexer_unique_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_502left_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_504left_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_506left_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_508left_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_510left_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_512outer_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_514outer_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_516outer_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_518outer_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_520outer_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_522inner_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_524inner_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_526inner_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_528inner_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */
static PyObject *__pyx_pf_6pandas_5algos_530inner_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_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_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__31[] = "()";
static char __pyx_k__33[] = "|";
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_typ[] = "_typ";
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__389[] = "_";
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_bias[] = "bias";
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_next[] = "next";
static char __pyx_k_nobs[] = "nobs";
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_alpha[] = "alpha";
static char __pyx_k_array[] = "array";
static char __pyx_k_class[] = "__class__";
static char __pyx_k_count[] = "count";
static char __pyx_k_cur_x[] = "cur_x";
static char __pyx_k_cur_y[] = "cur_y";
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_floor[] = "floor";
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_ewmcov[] = "ewmcov";
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_mean_y[] = "mean_y";
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_new_wt[] = "new_wt";
static char __pyx_k_nright[] = "nright";
static char __pyx_k_object[] = "object";
static char __pyx_k_offset[] = "offset";
static char __pyx_k_old_wt[] = "old_wt";
static char __pyx_k_oldbuf[] = "oldbuf";
static char __pyx_k_output[] = "output";
static char __pyx_k_pandas[] = "pandas";
static char __pyx_k_period[] = "period";
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_sum_wt[] = "sum_wt";
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_argsort[] = "argsort";
static char __pyx_k_asarray[] = "asarray";
static char __pyx_k_average[] = "average";
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_input_x[] = "input_x";
static char __pyx_k_input_y[] = "input_y";
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_sum_wt2[] = "sum_wt2";
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_asobject[] = "asobject";
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_timelike[] = "timelike";
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_ignore_na[] = "ignore_na";
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_numerator[] = "numerator";
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_writeable[] = "writeable";
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_old_mean_x[] = "old_mean_x";
static char __pyx_k_old_mean_y[] = "old_mean_y";
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_concatenate[] = "concatenate";
static char __pyx_k_denominator[] = "denominator";
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_weighted_avg[] = "weighted_avg";
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_old_wt_factor[] = "old_wt_factor";
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_AttributeError[] = "AttributeError";
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_is_observation[] = "is_observation";
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_group_max_int64[] = "group_max_int64";
static char __pyx_k_group_min_int64[] = "group_min_int64";
static char __pyx_k_group_nth_int64[] = "group_nth_int64";
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_last_int64[] = "group_last_int64";
static char __pyx_k_group_nth_object[] = "group_nth_object";
static char __pyx_k_is_monotonic_dec[] = "is_monotonic_dec";
static char __pyx_k_is_monotonic_inc[] = "is_monotonic_inc";
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_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_group_max_bin_int64[] = "group_max_bin_int64";
static char __pyx_k_group_min_bin_int64[] = "group_min_bin_int64";
static char __pyx_k_group_nth_bin_int64[] = "group_nth_bin_int64";
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_last_bin_int64[] = "group_last_bin_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_Users_jreback_pandas_pandas_alg[] = "/Users/jreback/pandas/pandas/algos.pyx";
static char __pyx_k_arrays_are_of_different_lengths[] = "arrays are of different lengths (%d and %d)";
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_Argument_values_must_have_only_o[] = "Argument 'values' must have only one dimension";
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_kp_s_Argument_values_must_have_only_o;
static PyObject *__pyx_n_s_AssertionError;
static PyObject *__pyx_n_s_AttributeError;
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_kp_s_Users_jreback_pandas_pandas_alg;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_s__31;
static PyObject *__pyx_kp_s__33;
static PyObject *__pyx_n_s__389;
static PyObject *__pyx_n_s_a;
static PyObject *__pyx_n_s_adjust;
static PyObject *__pyx_n_s_ai;
static PyObject *__pyx_n_s_allocate_buffer;
static PyObject *__pyx_n_s_alpha;
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_kp_s_arrays_are_of_different_lengths;
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_asobject;
static PyObject *__pyx_n_s_astype;
static PyObject *__pyx_n_s_average;
static PyObject *__pyx_n_s_avg;
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_bias;
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_n_s_concatenate;
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_cur_x;
static PyObject *__pyx_n_s_cur_y;
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_denominator;
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_ewmcov;
static PyObject *__pyx_n_s_expected_size;
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_floor;
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_int64;
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_int64;
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_bin_int64;
static PyObject *__pyx_n_s_group_max_float32;
static PyObject *__pyx_n_s_group_max_float64;
static PyObject *__pyx_n_s_group_max_int64;
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_bin_int64;
static PyObject *__pyx_n_s_group_min_float32;
static PyObject *__pyx_n_s_group_min_float64;
static PyObject *__pyx_n_s_group_min_int64;
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_int64;
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_int64;
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_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_ignore_na;
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_input_x;
static PyObject *__pyx_n_s_input_y;
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_dec;
static PyObject *__pyx_n_s_is_monotonic_float32;
static PyObject *__pyx_n_s_is_monotonic_float64;
static PyObject *__pyx_n_s_is_monotonic_inc;
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_observation;
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_mean_y;
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_new_wt;
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_numerator;
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_old_mean_x;
static PyObject *__pyx_n_s_old_mean_y;
static PyObject *__pyx_n_s_old_wt;
static PyObject *__pyx_n_s_old_wt_factor;
static PyObject *__pyx_n_s_oldbuf;
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_period;
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_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_wt;
static PyObject *__pyx_n_s_sum_wt2;
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_timelike;
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_typ;
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_weighted_avg;
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_writeable;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_xi;
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_float_0_;
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_9223372036854775807;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_neg_9223372036854775807;
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_k__192;
static PyObject *__pyx_k__193;
static PyObject *__pyx_k__194;
static PyObject *__pyx_k__195;
static PyObject *__pyx_k__196;
static PyObject *__pyx_k__197;
static PyObject *__pyx_k__198;
static PyObject *__pyx_k__199;
static PyObject *__pyx_k__200;
static PyObject *__pyx_k__201;
static PyObject *__pyx_k__202;
static PyObject *__pyx_k__203;
static PyObject *__pyx_k__204;
static PyObject *__pyx_k__205;
static PyObject *__pyx_k__206;
static PyObject *__pyx_k__207;
static PyObject *__pyx_k__208;
static PyObject *__pyx_k__209;
static PyObject *__pyx_k__210;
static PyObject *__pyx_k__211;
static PyObject *__pyx_k__212;
static PyObject *__pyx_k__213;
static PyObject *__pyx_k__214;
static PyObject *__pyx_k__215;
static PyObject *__pyx_k__216;
static PyObject *__pyx_k__217;
static PyObject *__pyx_k__218;
static PyObject *__pyx_k__219;
static PyObject *__pyx_k__220;
static PyObject *__pyx_k__221;
static PyObject *__pyx_k__222;
static PyObject *__pyx_k__223;
static PyObject *__pyx_k__224;
static PyObject *__pyx_k__225;
static PyObject *__pyx_k__226;
static PyObject *__pyx_k__227;
static PyObject *__pyx_k__228;
static PyObject *__pyx_k__229;
static PyObject *__pyx_k__230;
static PyObject *__pyx_k__231;
static PyObject *__pyx_k__232;
static PyObject *__pyx_k__233;
static PyObject *__pyx_k__234;
static PyObject *__pyx_k__235;
static PyObject *__pyx_k__236;
static PyObject *__pyx_k__237;
static PyObject *__pyx_k__238;
static PyObject *__pyx_k__239;
static PyObject *__pyx_k__240;
static PyObject *__pyx_k__241;
static PyObject *__pyx_k__242;
static PyObject *__pyx_k__243;
static PyObject *__pyx_k__244;
static PyObject *__pyx_k__245;
static PyObject *__pyx_k__246;
static PyObject *__pyx_k__247;
static PyObject *__pyx_k__248;
static PyObject *__pyx_k__249;
static PyObject *__pyx_k__250;
static PyObject *__pyx_k__251;
static PyObject *__pyx_k__252;
static PyObject *__pyx_k__253;
static PyObject *__pyx_k__254;
static PyObject *__pyx_k__255;
static PyObject *__pyx_k__256;
static PyObject *__pyx_k__257;
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__44;
static PyObject *__pyx_slice__45;
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__32;
static PyObject *__pyx_tuple__34;
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__46;
static PyObject *__pyx_tuple__47;
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_slice__307;
static PyObject *__pyx_slice__308;
static PyObject *__pyx_slice__309;
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__116;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_tuple__131;
static PyObject *__pyx_tuple__132;
static PyObject *__pyx_tuple__133;
static PyObject *__pyx_tuple__134;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__136;
static PyObject *__pyx_tuple__137;
static PyObject *__pyx_tuple__138;
static PyObject *__pyx_tuple__139;
static PyObject *__pyx_tuple__140;
static PyObject *__pyx_tuple__141;
static PyObject *__pyx_tuple__142;
static PyObject *__pyx_tuple__143;
static PyObject *__pyx_tuple__258;
static PyObject *__pyx_tuple__259;
static PyObject *__pyx_tuple__260;
static PyObject *__pyx_tuple__261;
static PyObject *__pyx_tuple__262;
static PyObject *__pyx_tuple__263;
static PyObject *__pyx_tuple__264;
static PyObject *__pyx_tuple__265;
static PyObject *__pyx_tuple__266;
static PyObject *__pyx_tuple__267;
static PyObject *__pyx_tuple__268;
static PyObject *__pyx_tuple__269;
static PyObject *__pyx_tuple__270;
static PyObject *__pyx_tuple__271;
static PyObject *__pyx_tuple__272;
static PyObject *__pyx_tuple__273;
static PyObject *__pyx_tuple__274;
static PyObject *__pyx_tuple__275;
static PyObject *__pyx_tuple__276;
static PyObject *__pyx_tuple__277;
static PyObject *__pyx_tuple__278;
static PyObject *__pyx_tuple__279;
static PyObject *__pyx_tuple__280;
static PyObject *__pyx_tuple__281;
static PyObject *__pyx_tuple__282;
static PyObject *__pyx_tuple__283;
static PyObject *__pyx_tuple__284;
static PyObject *__pyx_tuple__285;
static PyObject *__pyx_tuple__286;
static PyObject *__pyx_tuple__287;
static PyObject *__pyx_tuple__288;
static PyObject *__pyx_tuple__289;
static PyObject *__pyx_tuple__290;
static PyObject *__pyx_tuple__291;
static PyObject *__pyx_tuple__292;
static PyObject *__pyx_tuple__293;
static PyObject *__pyx_tuple__294;
static PyObject *__pyx_tuple__295;
static PyObject *__pyx_tuple__296;
static PyObject *__pyx_tuple__297;
static PyObject *__pyx_tuple__298;
static PyObject *__pyx_tuple__299;
static PyObject *__pyx_tuple__300;
static PyObject *__pyx_tuple__301;
static PyObject *__pyx_tuple__302;
static PyObject *__pyx_tuple__303;
static PyObject *__pyx_tuple__304;
static PyObject *__pyx_tuple__305;
static PyObject *__pyx_tuple__306;
static PyObject *__pyx_tuple__310;
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__321;
static PyObject *__pyx_tuple__323;
static PyObject *__pyx_tuple__325;
static PyObject *__pyx_tuple__327;
static PyObject *__pyx_tuple__329;
static PyObject *__pyx_tuple__331;
static PyObject *__pyx_tuple__333;
static PyObject *__pyx_tuple__335;
static PyObject *__pyx_tuple__337;
static PyObject *__pyx_tuple__339;
static PyObject *__pyx_tuple__341;
static PyObject *__pyx_tuple__343;
static PyObject *__pyx_tuple__345;
static PyObject *__pyx_tuple__347;
static PyObject *__pyx_tuple__349;
static PyObject *__pyx_tuple__351;
static PyObject *__pyx_tuple__353;
static PyObject *__pyx_tuple__355;
static PyObject *__pyx_tuple__357;
static PyObject *__pyx_tuple__359;
static PyObject *__pyx_tuple__361;
static PyObject *__pyx_tuple__363;
static PyObject *__pyx_tuple__365;
static PyObject *__pyx_tuple__367;
static PyObject *__pyx_tuple__369;
static PyObject *__pyx_tuple__371;
static PyObject *__pyx_tuple__373;
static PyObject *__pyx_tuple__375;
static PyObject *__pyx_tuple__377;
static PyObject *__pyx_tuple__379;
static PyObject *__pyx_tuple__381;
static PyObject *__pyx_tuple__383;
static PyObject *__pyx_tuple__385;
static PyObject *__pyx_tuple__387;
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__401;
static PyObject *__pyx_tuple__403;
static PyObject *__pyx_tuple__405;
static PyObject *__pyx_tuple__407;
static PyObject *__pyx_tuple__409;
static PyObject *__pyx_tuple__411;
static PyObject *__pyx_tuple__413;
static PyObject *__pyx_tuple__415;
static PyObject *__pyx_tuple__417;
static PyObject *__pyx_tuple__419;
static PyObject *__pyx_tuple__421;
static PyObject *__pyx_tuple__423;
static PyObject *__pyx_tuple__425;
static PyObject *__pyx_tuple__427;
static PyObject *__pyx_tuple__429;
static PyObject *__pyx_tuple__431;
static PyObject *__pyx_tuple__433;
static PyObject *__pyx_tuple__435;
static PyObject *__pyx_tuple__437;
static PyObject *__pyx_tuple__439;
static PyObject *__pyx_tuple__441;
static PyObject *__pyx_tuple__443;
static PyObject *__pyx_tuple__445;
static PyObject *__pyx_tuple__447;
static PyObject *__pyx_tuple__449;
static PyObject *__pyx_tuple__451;
static PyObject *__pyx_tuple__453;
static PyObject *__pyx_tuple__455;
static PyObject *__pyx_tuple__457;
static PyObject *__pyx_tuple__459;
static PyObject *__pyx_tuple__461;
static PyObject *__pyx_tuple__463;
static PyObject *__pyx_tuple__465;
static PyObject *__pyx_tuple__467;
static PyObject *__pyx_tuple__469;
static PyObject *__pyx_tuple__471;
static PyObject *__pyx_tuple__473;
static PyObject *__pyx_tuple__475;
static PyObject *__pyx_tuple__477;
static PyObject *__pyx_tuple__479;
static PyObject *__pyx_tuple__481;
static PyObject *__pyx_tuple__483;
static PyObject *__pyx_tuple__485;
static PyObject *__pyx_tuple__487;
static PyObject *__pyx_tuple__489;
static PyObject *__pyx_tuple__491;
static PyObject *__pyx_tuple__493;
static PyObject *__pyx_tuple__495;
static PyObject *__pyx_tuple__497;
static PyObject *__pyx_tuple__499;
static PyObject *__pyx_tuple__501;
static PyObject *__pyx_tuple__503;
static PyObject *__pyx_tuple__505;
static PyObject *__pyx_tuple__507;
static PyObject *__pyx_tuple__509;
static PyObject *__pyx_tuple__511;
static PyObject *__pyx_tuple__513;
static PyObject *__pyx_tuple__515;
static PyObject *__pyx_tuple__517;
static PyObject *__pyx_tuple__519;
static PyObject *__pyx_tuple__521;
static PyObject *__pyx_tuple__523;
static PyObject *__pyx_tuple__525;
static PyObject *__pyx_tuple__527;
static PyObject *__pyx_tuple__529;
static PyObject *__pyx_tuple__531;
static PyObject *__pyx_tuple__533;
static PyObject *__pyx_tuple__535;
static PyObject *__pyx_tuple__537;
static PyObject *__pyx_tuple__539;
static PyObject *__pyx_tuple__541;
static PyObject *__pyx_tuple__543;
static PyObject *__pyx_tuple__545;
static PyObject *__pyx_tuple__547;
static PyObject *__pyx_tuple__549;
static PyObject *__pyx_tuple__551;
static PyObject *__pyx_tuple__553;
static PyObject *__pyx_tuple__555;
static PyObject *__pyx_tuple__557;
static PyObject *__pyx_tuple__559;
static PyObject *__pyx_tuple__561;
static PyObject *__pyx_tuple__563;
static PyObject *__pyx_tuple__565;
static PyObject *__pyx_tuple__567;
static PyObject *__pyx_tuple__569;
static PyObject *__pyx_tuple__571;
static PyObject *__pyx_tuple__573;
static PyObject *__pyx_tuple__575;
static PyObject *__pyx_tuple__577;
static PyObject *__pyx_tuple__579;
static PyObject *__pyx_tuple__581;
static PyObject *__pyx_tuple__583;
static PyObject *__pyx_tuple__585;
static PyObject *__pyx_tuple__587;
static PyObject *__pyx_tuple__589;
static PyObject *__pyx_tuple__591;
static PyObject *__pyx_tuple__593;
static PyObject *__pyx_tuple__595;
static PyObject *__pyx_tuple__597;
static PyObject *__pyx_tuple__599;
static PyObject *__pyx_tuple__601;
static PyObject *__pyx_tuple__603;
static PyObject *__pyx_tuple__605;
static PyObject *__pyx_tuple__607;
static PyObject *__pyx_tuple__609;
static PyObject *__pyx_tuple__611;
static PyObject *__pyx_tuple__613;
static PyObject *__pyx_tuple__615;
static PyObject *__pyx_tuple__617;
static PyObject *__pyx_tuple__619;
static PyObject *__pyx_tuple__621;
static PyObject *__pyx_tuple__623;
static PyObject *__pyx_tuple__625;
static PyObject *__pyx_tuple__627;
static PyObject *__pyx_tuple__629;
static PyObject *__pyx_tuple__631;
static PyObject *__pyx_tuple__633;
static PyObject *__pyx_tuple__635;
static PyObject *__pyx_tuple__637;
static PyObject *__pyx_tuple__639;
static PyObject *__pyx_tuple__641;
static PyObject *__pyx_tuple__643;
static PyObject *__pyx_tuple__645;
static PyObject *__pyx_tuple__647;
static PyObject *__pyx_tuple__649;
static PyObject *__pyx_tuple__651;
static PyObject *__pyx_tuple__653;
static PyObject *__pyx_tuple__655;
static PyObject *__pyx_tuple__657;
static PyObject *__pyx_tuple__659;
static PyObject *__pyx_tuple__661;
static PyObject *__pyx_tuple__663;
static PyObject *__pyx_tuple__665;
static PyObject *__pyx_tuple__667;
static PyObject *__pyx_tuple__669;
static PyObject *__pyx_tuple__671;
static PyObject *__pyx_tuple__673;
static PyObject *__pyx_tuple__675;
static PyObject *__pyx_tuple__677;
static PyObject *__pyx_tuple__679;
static PyObject *__pyx_tuple__681;
static PyObject *__pyx_tuple__683;
static PyObject *__pyx_tuple__685;
static PyObject *__pyx_tuple__687;
static PyObject *__pyx_tuple__689;
static PyObject *__pyx_tuple__691;
static PyObject *__pyx_tuple__693;
static PyObject *__pyx_tuple__695;
static PyObject *__pyx_tuple__697;
static PyObject *__pyx_tuple__699;
static PyObject *__pyx_tuple__701;
static PyObject *__pyx_tuple__703;
static PyObject *__pyx_tuple__705;
static PyObject *__pyx_tuple__707;
static PyObject *__pyx_tuple__709;
static PyObject *__pyx_tuple__711;
static PyObject *__pyx_tuple__713;
static PyObject *__pyx_tuple__715;
static PyObject *__pyx_tuple__717;
static PyObject *__pyx_tuple__719;
static PyObject *__pyx_tuple__721;
static PyObject *__pyx_tuple__723;
static PyObject *__pyx_tuple__725;
static PyObject *__pyx_tuple__727;
static PyObject *__pyx_tuple__729;
static PyObject *__pyx_tuple__731;
static PyObject *__pyx_tuple__733;
static PyObject *__pyx_tuple__735;
static PyObject *__pyx_tuple__737;
static PyObject *__pyx_tuple__739;
static PyObject *__pyx_tuple__741;
static PyObject *__pyx_tuple__743;
static PyObject *__pyx_tuple__745;
static PyObject *__pyx_tuple__747;
static PyObject *__pyx_tuple__749;
static PyObject *__pyx_tuple__751;
static PyObject *__pyx_tuple__753;
static PyObject *__pyx_tuple__755;
static PyObject *__pyx_tuple__757;
static PyObject *__pyx_tuple__759;
static PyObject *__pyx_tuple__761;
static PyObject *__pyx_tuple__763;
static PyObject *__pyx_tuple__765;
static PyObject *__pyx_tuple__767;
static PyObject *__pyx_tuple__769;
static PyObject *__pyx_tuple__771;
static PyObject *__pyx_tuple__773;
static PyObject *__pyx_tuple__775;
static PyObject *__pyx_tuple__777;
static PyObject *__pyx_tuple__779;
static PyObject *__pyx_tuple__781;
static PyObject *__pyx_tuple__783;
static PyObject *__pyx_tuple__785;
static PyObject *__pyx_tuple__787;
static PyObject *__pyx_tuple__789;
static PyObject *__pyx_tuple__791;
static PyObject *__pyx_tuple__793;
static PyObject *__pyx_tuple__795;
static PyObject *__pyx_tuple__797;
static PyObject *__pyx_tuple__799;
static PyObject *__pyx_tuple__801;
static PyObject *__pyx_tuple__803;
static PyObject *__pyx_tuple__805;
static PyObject *__pyx_tuple__807;
static PyObject *__pyx_tuple__809;
static PyObject *__pyx_tuple__811;
static PyObject *__pyx_tuple__813;
static PyObject *__pyx_tuple__815;
static PyObject *__pyx_tuple__817;
static PyObject *__pyx_tuple__818;
static PyObject *__pyx_tuple__819;
static PyObject *__pyx_tuple__820;
static PyObject *__pyx_tuple__821;
static PyObject *__pyx_codeobj__312;
static PyObject *__pyx_codeobj__314;
static PyObject *__pyx_codeobj__316;
static PyObject *__pyx_codeobj__318;
static PyObject *__pyx_codeobj__320;
static PyObject *__pyx_codeobj__322;
static PyObject *__pyx_codeobj__324;
static PyObject *__pyx_codeobj__326;
static PyObject *__pyx_codeobj__328;
static PyObject *__pyx_codeobj__330;
static PyObject *__pyx_codeobj__332;
static PyObject *__pyx_codeobj__334;
static PyObject *__pyx_codeobj__336;
static PyObject *__pyx_codeobj__338;
static PyObject *__pyx_codeobj__340;
static PyObject *__pyx_codeobj__342;
static PyObject *__pyx_codeobj__344;
static PyObject *__pyx_codeobj__346;
static PyObject *__pyx_codeobj__348;
static PyObject *__pyx_codeobj__350;
static PyObject *__pyx_codeobj__352;
static PyObject *__pyx_codeobj__354;
static PyObject *__pyx_codeobj__356;
static PyObject *__pyx_codeobj__358;
static PyObject *__pyx_codeobj__360;
static PyObject *__pyx_codeobj__362;
static PyObject *__pyx_codeobj__364;
static PyObject *__pyx_codeobj__366;
static PyObject *__pyx_codeobj__368;
static PyObject *__pyx_codeobj__370;
static PyObject *__pyx_codeobj__372;
static PyObject *__pyx_codeobj__374;
static PyObject *__pyx_codeobj__376;
static PyObject *__pyx_codeobj__378;
static PyObject *__pyx_codeobj__380;
static PyObject *__pyx_codeobj__382;
static PyObject *__pyx_codeobj__384;
static PyObject *__pyx_codeobj__386;
static PyObject *__pyx_codeobj__388;
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__402;
static PyObject *__pyx_codeobj__404;
static PyObject *__pyx_codeobj__406;
static PyObject *__pyx_codeobj__408;
static PyObject *__pyx_codeobj__410;
static PyObject *__pyx_codeobj__412;
static PyObject *__pyx_codeobj__414;
static PyObject *__pyx_codeobj__416;
static PyObject *__pyx_codeobj__418;
static PyObject *__pyx_codeobj__420;
static PyObject *__pyx_codeobj__422;
static PyObject *__pyx_codeobj__424;
static PyObject *__pyx_codeobj__426;
static PyObject *__pyx_codeobj__428;
static PyObject *__pyx_codeobj__430;
static PyObject *__pyx_codeobj__432;
static PyObject *__pyx_codeobj__434;
static PyObject *__pyx_codeobj__436;
static PyObject *__pyx_codeobj__438;
static PyObject *__pyx_codeobj__440;
static PyObject *__pyx_codeobj__442;
static PyObject *__pyx_codeobj__444;
static PyObject *__pyx_codeobj__446;
static PyObject *__pyx_codeobj__448;
static PyObject *__pyx_codeobj__450;
static PyObject *__pyx_codeobj__452;
static PyObject *__pyx_codeobj__454;
static PyObject *__pyx_codeobj__456;
static PyObject *__pyx_codeobj__458;
static PyObject *__pyx_codeobj__460;
static PyObject *__pyx_codeobj__462;
static PyObject *__pyx_codeobj__464;
static PyObject *__pyx_codeobj__466;
static PyObject *__pyx_codeobj__468;
static PyObject *__pyx_codeobj__470;
static PyObject *__pyx_codeobj__472;
static PyObject *__pyx_codeobj__474;
static PyObject *__pyx_codeobj__476;
static PyObject *__pyx_codeobj__478;
static PyObject *__pyx_codeobj__480;
static PyObject *__pyx_codeobj__482;
static PyObject *__pyx_codeobj__484;
static PyObject *__pyx_codeobj__486;
static PyObject *__pyx_codeobj__488;
static PyObject *__pyx_codeobj__490;
static PyObject *__pyx_codeobj__492;
static PyObject *__pyx_codeobj__494;
static PyObject *__pyx_codeobj__496;
static PyObject *__pyx_codeobj__498;
static PyObject *__pyx_codeobj__500;
static PyObject *__pyx_codeobj__502;
static PyObject *__pyx_codeobj__504;
static PyObject *__pyx_codeobj__506;
static PyObject *__pyx_codeobj__508;
static PyObject *__pyx_codeobj__510;
static PyObject *__pyx_codeobj__512;
static PyObject *__pyx_codeobj__514;
static PyObject *__pyx_codeobj__516;
static PyObject *__pyx_codeobj__518;
static PyObject *__pyx_codeobj__520;
static PyObject *__pyx_codeobj__522;
static PyObject *__pyx_codeobj__524;
static PyObject *__pyx_codeobj__526;
static PyObject *__pyx_codeobj__528;
static PyObject *__pyx_codeobj__530;
static PyObject *__pyx_codeobj__532;
static PyObject *__pyx_codeobj__534;
static PyObject *__pyx_codeobj__536;
static PyObject *__pyx_codeobj__538;
static PyObject *__pyx_codeobj__540;
static PyObject *__pyx_codeobj__542;
static PyObject *__pyx_codeobj__544;
static PyObject *__pyx_codeobj__546;
static PyObject *__pyx_codeobj__548;
static PyObject *__pyx_codeobj__550;
static PyObject *__pyx_codeobj__552;
static PyObject *__pyx_codeobj__554;
static PyObject *__pyx_codeobj__556;
static PyObject *__pyx_codeobj__558;
static PyObject *__pyx_codeobj__560;
static PyObject *__pyx_codeobj__562;
static PyObject *__pyx_codeobj__564;
static PyObject *__pyx_codeobj__566;
static PyObject *__pyx_codeobj__568;
static PyObject *__pyx_codeobj__570;
static PyObject *__pyx_codeobj__572;
static PyObject *__pyx_codeobj__574;
static PyObject *__pyx_codeobj__576;
static PyObject *__pyx_codeobj__578;
static PyObject *__pyx_codeobj__580;
static PyObject *__pyx_codeobj__582;
static PyObject *__pyx_codeobj__584;
static PyObject *__pyx_codeobj__586;
static PyObject *__pyx_codeobj__588;
static PyObject *__pyx_codeobj__590;
static PyObject *__pyx_codeobj__592;
static PyObject *__pyx_codeobj__594;
static PyObject *__pyx_codeobj__596;
static PyObject *__pyx_codeobj__598;
static PyObject *__pyx_codeobj__600;
static PyObject *__pyx_codeobj__602;
static PyObject *__pyx_codeobj__604;
static PyObject *__pyx_codeobj__606;
static PyObject *__pyx_codeobj__608;
static PyObject *__pyx_codeobj__610;
static PyObject *__pyx_codeobj__612;
static PyObject *__pyx_codeobj__614;
static PyObject *__pyx_codeobj__616;
static PyObject *__pyx_codeobj__618;
static PyObject *__pyx_codeobj__620;
static PyObject *__pyx_codeobj__622;
static PyObject *__pyx_codeobj__624;
static PyObject *__pyx_codeobj__626;
static PyObject *__pyx_codeobj__628;
static PyObject *__pyx_codeobj__630;
static PyObject *__pyx_codeobj__632;
static PyObject *__pyx_codeobj__634;
static PyObject *__pyx_codeobj__636;
static PyObject *__pyx_codeobj__638;
static PyObject *__pyx_codeobj__640;
static PyObject *__pyx_codeobj__642;
static PyObject *__pyx_codeobj__644;
static PyObject *__pyx_codeobj__646;
static PyObject *__pyx_codeobj__648;
static PyObject *__pyx_codeobj__650;
static PyObject *__pyx_codeobj__652;
static PyObject *__pyx_codeobj__654;
static PyObject *__pyx_codeobj__656;
static PyObject *__pyx_codeobj__658;
static PyObject *__pyx_codeobj__660;
static PyObject *__pyx_codeobj__662;
static PyObject *__pyx_codeobj__664;
static PyObject *__pyx_codeobj__666;
static PyObject *__pyx_codeobj__668;
static PyObject *__pyx_codeobj__670;
static PyObject *__pyx_codeobj__672;
static PyObject *__pyx_codeobj__674;
static PyObject *__pyx_codeobj__676;
static PyObject *__pyx_codeobj__678;
static PyObject *__pyx_codeobj__680;
static PyObject *__pyx_codeobj__682;
static PyObject *__pyx_codeobj__684;
static PyObject *__pyx_codeobj__686;
static PyObject *__pyx_codeobj__688;
static PyObject *__pyx_codeobj__690;
static PyObject *__pyx_codeobj__692;
static PyObject *__pyx_codeobj__694;
static PyObject *__pyx_codeobj__696;
static PyObject *__pyx_codeobj__698;
static PyObject *__pyx_codeobj__700;
static PyObject *__pyx_codeobj__702;
static PyObject *__pyx_codeobj__704;
static PyObject *__pyx_codeobj__706;
static PyObject *__pyx_codeobj__708;
static PyObject *__pyx_codeobj__710;
static PyObject *__pyx_codeobj__712;
static PyObject *__pyx_codeobj__714;
static PyObject *__pyx_codeobj__716;
static PyObject *__pyx_codeobj__718;
static PyObject *__pyx_codeobj__720;
static PyObject *__pyx_codeobj__722;
static PyObject *__pyx_codeobj__724;
static PyObject *__pyx_codeobj__726;
static PyObject *__pyx_codeobj__728;
static PyObject *__pyx_codeobj__730;
static PyObject *__pyx_codeobj__732;
static PyObject *__pyx_codeobj__734;
static PyObject *__pyx_codeobj__736;
static PyObject *__pyx_codeobj__738;
static PyObject *__pyx_codeobj__740;
static PyObject *__pyx_codeobj__742;
static PyObject *__pyx_codeobj__744;
static PyObject *__pyx_codeobj__746;
static PyObject *__pyx_codeobj__748;
static PyObject *__pyx_codeobj__750;
static PyObject *__pyx_codeobj__752;
static PyObject *__pyx_codeobj__754;
static PyObject *__pyx_codeobj__756;
static PyObject *__pyx_codeobj__758;
static PyObject *__pyx_codeobj__760;
static PyObject *__pyx_codeobj__762;
static PyObject *__pyx_codeobj__764;
static PyObject *__pyx_codeobj__766;
static PyObject *__pyx_codeobj__768;
static PyObject *__pyx_codeobj__770;
static PyObject *__pyx_codeobj__772;
static PyObject *__pyx_codeobj__774;
static PyObject *__pyx_codeobj__776;
static PyObject *__pyx_codeobj__778;
static PyObject *__pyx_codeobj__780;
static PyObject *__pyx_codeobj__782;
static PyObject *__pyx_codeobj__784;
static PyObject *__pyx_codeobj__786;
static PyObject *__pyx_codeobj__788;
static PyObject *__pyx_codeobj__790;
static PyObject *__pyx_codeobj__792;
static PyObject *__pyx_codeobj__794;
static PyObject *__pyx_codeobj__796;
static PyObject *__pyx_codeobj__798;
static PyObject *__pyx_codeobj__800;
static PyObject *__pyx_codeobj__802;
static PyObject *__pyx_codeobj__804;
static PyObject *__pyx_codeobj__806;
static PyObject *__pyx_codeobj__808;
static PyObject *__pyx_codeobj__810;
static PyObject *__pyx_codeobj__812;
static PyObject *__pyx_codeobj__814;
static PyObject *__pyx_codeobj__816;

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

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_532lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_532lambda1 = {"lambda1", (PyCFunction)__pyx_pw_6pandas_5algos_532lambda1, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_532lambda1(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 = 552; __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 = 552; __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 = 552; __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":553
 * 
 * _return_false = lambda self, other: False
 * _return_true = lambda self, other: True             # <<<<<<<<<<<<<<
 * 
 * class Infinity(object):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_533lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_533lambda2 = {"lambda2", (PyCFunction)__pyx_pw_6pandas_5algos_533lambda2, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_533lambda2(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 = 553; __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 = 553; __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 = 553; __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":54
 * 
 * 
 * cdef inline int int_max(int a, int b): return a if a >= b else b             # <<<<<<<<<<<<<<
 * cdef inline int int_min(int a, int b): return a if a <= b else b
 * 
 */

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":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_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;
  PyObject *__pyx_t_4 = NULL;
  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;
  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_3 = PyInt_FromSsize_t(__pyx_v_i); 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);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __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); __pyx_t_5 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, 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_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_7 = (__pyx_v_self->maxlevels - 1); __pyx_t_7 > -1; __pyx_t_7-=1) {
    __pyx_v_level = __pyx_t_7;

    /* "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_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__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_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!__pyx_t_8) 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_4 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      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_4, __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_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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[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_9;

      /* "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_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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 = __pyx_f_6pandas_5algos_17IndexableSkiplist_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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  double __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = 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_3 = PyFloat_FromDouble(__pyx_v_value); 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);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __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); __pyx_t_5 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, 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_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_7 = (__pyx_v_self->maxlevels - 1); __pyx_t_7 > -1; __pyx_t_7-=1) {
    __pyx_v_level = __pyx_t_7;

    /* "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_8 = ((__pyx_v_next_at_level->value <= __pyx_v_value) != 0);
      if (!__pyx_t_8) 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_4 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 95; __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 (unlikely(__Pyx_SetItemInt(__pyx_v_steps_at_level, __pyx_v_level, __pyx_t_4, 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_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_List(__pyx_v_node->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __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_4));
      __pyx_t_4 = 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_random); 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_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyFloat_FromDouble(__pyx_f_6pandas_5algos_Log2(__pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __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(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Subtract(__pyx_int_1, __pyx_t_4); 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_4); __pyx_t_4 = 0;
  __pyx_t_7 = __pyx_v_self->maxlevels;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); 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_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__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_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_8) {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __pyx_t_6;
    __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_d = __pyx_t_7;

  /* "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_4 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyList_New(1 * ((__pyx_v_d<0) ? 0:__pyx_v_d)); 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);
  { 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_2, __pyx_temp, Py_None);
      __Pyx_GIVEREF(Py_None);
    }
  }
  __pyx_t_6 = PyList_New(1 * ((__pyx_v_d<0) ? 0:__pyx_v_d)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  { 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_6, __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_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_4 = 0;
  __pyx_t_2 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5algos_Node)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_newnode = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_6);
  __pyx_t_6 = 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_7 = __pyx_v_d;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_7; __pyx_t_10+=1) {
    __pyx_v_level = __pyx_t_10;

    /* "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_6 = __Pyx_GetItemInt_List(__pyx_v_chain, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_6);
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __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_6));
    __pyx_t_6 = 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_6 = __Pyx_GetItemInt_List(__pyx_v_prevnode->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_6);
    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_6, 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_6); __pyx_t_6 = 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_6 = __Pyx_GetItemInt_List(__pyx_v_prevnode->width, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_6);
    __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_2 = PyNumber_Subtract(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __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_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_2, 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_2); __pyx_t_2 = 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_2 = PyInt_FromSsize_t((__pyx_v_steps + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    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_2, 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_2); __pyx_t_2 = 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_2 = PyInt_FromSsize_t(__pyx_v_steps); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __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_6 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __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_1); __pyx_t_1 = 0;
    __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_11 == (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_6); __pyx_t_6 = 0;
    __pyx_v_steps = __pyx_t_11;
  }

  /* "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_7 = __pyx_v_self->maxlevels;
  for (__pyx_t_10 = __pyx_v_d; __pyx_t_10 < __pyx_t_7; __pyx_t_10+=1) {
    __pyx_v_level = __pyx_t_10;

    /* "pandas/src/skiplist.pyx":116
 * 
 *         for level in range(d, self.maxlevels):
 *             (<Node> chain[level]).width[level] += 1             # <<<<<<<<<<<<<<
 * 
 *         self.size += 1
 */
    __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_chain, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_6)->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_6)->width);
    __pyx_t_12 = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_6)->width;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_11 = __pyx_v_level;
    if (unlikely(__pyx_t_12 == 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_6 = __Pyx_GetItemInt_List(__pyx_t_12, __pyx_t_11, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_6, __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_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_t_12 == 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_12, __pyx_t_11, __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_12); __pyx_t_12 = 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_12);
  __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 = __pyx_f_6pandas_5algos_17IndexableSkiplist_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;
  PyObject *__pyx_t_4 = NULL;
  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;
  Py_ssize_t __pyx_t_11;
  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_3 = PyFloat_FromDouble(__pyx_v_value); 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);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __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); __pyx_t_5 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, 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_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_7 = (__pyx_v_self->maxlevels - 1); __pyx_t_7 > -1; __pyx_t_7-=1) {
    __pyx_v_level = __pyx_t_7;

    /* "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_8 = ((__pyx_v_next_at_level->value < __pyx_v_value) != 0);
      if (!__pyx_t_8) 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_8 = ((__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_8) {

    /* "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_7 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_7 == -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_7;

  /* "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_7 = __pyx_v_d;
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_7; __pyx_t_9+=1) {
    __pyx_v_level = __pyx_t_9;

    /* "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_10 = __pyx_v_prevnode->width;
    __pyx_t_11 = __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 = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_t_10, __pyx_t_11, 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_4 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_4); 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_4); __pyx_t_4 = 0;
    if (unlikely(__pyx_t_10 == 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_10, __pyx_t_11, __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_10); __pyx_t_10 = 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_7 = __pyx_v_self->maxlevels;
  for (__pyx_t_9 = __pyx_v_d; __pyx_t_9 < __pyx_t_7; __pyx_t_9+=1) {
    __pyx_v_level = __pyx_t_9;

    /* "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_10 = __pyx_v_tmpnode->width;
    __pyx_t_11 = __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 = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_t_10, __pyx_t_11, 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_4 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(__pyx_t_10 == 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_10, __pyx_t_11, __pyx_t_4, 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_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __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 = __pyx_f_6pandas_5algos_17IndexableSkiplist_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":92
 * # 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 = 92; __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":96
 *     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 = 96; __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 = 96; __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":100
 *         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 = 100; __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 = 100; __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 = 100; __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 = 100; __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 = 100; __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 = 100; __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 = 100; __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 = 100; __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 = 100; __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":101
 * 
 *     N, K = (<object> values).shape
 *     result = np.empty_like(values)             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         for j in range(K):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_values)); 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);
  } else {
    __pyx_t_4 = PyTuple_New(1+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);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_values));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((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 = 101; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_1);
  {
    __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 = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":102
 *     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":103
 *     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":104
 *     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 = 104; __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 = 104; __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 = 104; __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":105
 *         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":92
 * # 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":107
 *     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 = 107; __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":111
 *     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 = 111; __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 = 111; __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":115
 *         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 = 115; __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 = 115; __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 = 115; __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 = 115; __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 = 115; __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 = 115; __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 = 115; __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 = 115; __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 = 115; __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":116
 * 
 *     N, K = (<object> values).shape
 *     result = np.empty_like(values)             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         for j in range(K):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_values)); 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);
  } else {
    __pyx_t_4 = PyTuple_New(1+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);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_values));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((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 = 116; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_1);
  {
    __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 = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":117
 *     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":118
 *     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":119
 *     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 = 119; __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 = 119; __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 = 119; __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":120
 *         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":107
 *     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":122
 *     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 = 122; __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":126
 *     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 = 126; __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 = 126; __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":130
 *         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 = 130; __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 = 130; __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 = 130; __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 = 130; __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 = 130; __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 = 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[0]; __pyx_lineno = 130; __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 = 130; __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 = 130; __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":131
 * 
 *     N, K = (<object> values).shape
 *     result = values.copy()             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         for j in range(K):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_copy); 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);
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); 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);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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 = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_1);
  {
    __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 = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":132
 *     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":133
 *     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":134
 *     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 = 134; __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 = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = (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_1);
      __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 = 134; __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_1); __Pyx_DECREF(*__pyx_t_21);
      *__pyx_t_21 = __pyx_t_1;
      __Pyx_GIVEREF(*__pyx_t_21);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
  }

  /* "pandas/algos.pyx":135
 *         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":122
 *     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":138
 * 
 * 
 * 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 = {"rank_1d_float64", (PyCFunction)__pyx_pw_6pandas_5algos_1rank_1d_float64, METH_VARARGS|METH_KEYWORDS, __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":139
 * 
 * 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 = 138; __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 = 138; __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":138
 * 
 * 
 * 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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  __pyx_t_5numpy_float64_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  PyArrayObject *__pyx_t_15 = NULL;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  __pyx_t_5numpy_int64_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  __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":145
 * 
 *     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":149
 *         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":150
 *         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":151
 *         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":152
 *         int tiebreak = 0
 *         bint keep_na = 0
 *         float count = 0.0             # <<<<<<<<<<<<<<
 *     tiebreak = tiebreakers[ties_method]
 * 
 */
  __pyx_v_count = 0.0;

  /* "pandas/algos.pyx":153
 *         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 = 153; __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 = 153; __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 = 153; __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":155
 *     tiebreak = tiebreakers[ties_method]
 * 
 *     values = np.asarray(in_arr).copy()             # <<<<<<<<<<<<<<
 * 
 *     keep_na = na_option == 'keep'
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_in_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __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 = NULL;
    __Pyx_INCREF(__pyx_v_in_arr);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_in_arr);
    __Pyx_GIVEREF(__pyx_v_in_arr);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __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 = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((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_7, &__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_8, &__pyx_t_9, &__pyx_t_10);
      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_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_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 = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":157
 *     values = np.asarray(in_arr).copy()
 * 
 *     keep_na = na_option == 'keep'             # <<<<<<<<<<<<<<
 * 
 *     if ascending ^ (na_option == 'top'):
 */
  __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 = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_keep_na = __pyx_t_11;

  /* "pandas/algos.pyx":159
 *     keep_na = na_option == 'keep'
 * 
 *     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 = 159; __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 = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_11) {

    /* "pandas/algos.pyx":160
 * 
 *     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 = 160; __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 = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_12 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_nan_value = __pyx_t_12;
    goto __pyx_L3;
  }
  /*else*/ {

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

  /* "pandas/algos.pyx":163
 *     else:
 *         nan_value = -np.inf
 *     mask = np.isnan(values)             # <<<<<<<<<<<<<<
 *     np.putmask(values, mask, nan_value)
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isnan); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_values)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __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); __pyx_t_5 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_values));
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, ((PyObject *)__pyx_v_values));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __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_1); __pyx_t_1 = 0;
  __pyx_v_mask = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":164
 *         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 = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_putmask); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __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 = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  __pyx_t_13 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_13 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_5) {
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_13, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  __Pyx_INCREF(__pyx_v_mask);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_13, __pyx_v_mask);
  __Pyx_GIVEREF(__pyx_v_mask);
  PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_13, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":166
 *     np.putmask(values, mask, nan_value)
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     ranks = np.empty(n, dtype='f8')
 * 
 */
  __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_13;

  /* "pandas/algos.pyx":167
 * 
 *     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 = 167; __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 = 167; __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 = 167; __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 = 167; __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 = 167; __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 = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __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_4); __pyx_t_4 = 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 = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((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_7, &__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_10, &__pyx_t_9, &__pyx_t_8);
      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_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_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 = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":170
 * 
 *     # 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_11 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0);
  if (__pyx_t_11) {

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

    /* "pandas/algos.pyx":173
 *         # need to use a stable sort here
 *         _as = values.argsort(kind='mergesort')
 *         if not ascending:             # <<<<<<<<<<<<<<
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 */
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = ((!__pyx_t_11) != 0);
    if (__pyx_t_14) {

      /* "pandas/algos.pyx":174
 *         _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":176
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 *         _as = values.argsort()             # <<<<<<<<<<<<<<
 * 
 *     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 = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_1) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_2); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v__as = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L4:;

  /* "pandas/algos.pyx":178
 *         _as = values.argsort()
 * 
 *     if not ascending:             # <<<<<<<<<<<<<<
 *         _as = _as[::-1]
 * 
 */
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((!__pyx_t_14) != 0);
  if (__pyx_t_11) {

    /* "pandas/algos.pyx":179
 * 
 *     if not ascending:
 *         _as = _as[::-1]             # <<<<<<<<<<<<<<
 * 
 *     sorted_data = values.take(_as)
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v__as, __pyx_slice__2); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __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_L6;
  }
  __pyx_L6:;

  /* "pandas/algos.pyx":181
 *         _as = _as[::-1]
 * 
 *     sorted_data = values.take(_as)             # <<<<<<<<<<<<<<
 *     argsorted = _as.astype('i8')
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_take); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v__as); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v__as);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v__as);
    __Pyx_GIVEREF(__pyx_v__as);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __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_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 = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
  {
    __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_7, &__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_8, &__pyx_t_9, &__pyx_t_10);
      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_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_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 = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_sorted_data = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/algos.pyx":182
 * 
 *     sorted_data = values.take(_as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__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 = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = ((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_15, &__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_10, &__pyx_t_9, &__pyx_t_8);
      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_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_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 = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_15 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":184
 *     argsorted = _as.astype('i8')
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         sum_ranks += i + 1
 *         dups += 1
 */
  __pyx_t_13 = __pyx_v_n;
  for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_13; __pyx_t_16+=1) {
    __pyx_v_i = __pyx_t_16;

    /* "pandas/algos.pyx":185
 * 
 *     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":186
 *     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":187
 *         sum_ranks += i + 1
 *         dups += 1
 *         val = sorted_data[i]             # <<<<<<<<<<<<<<
 *         if (val == nan_value) and keep_na:
 *             ranks[argsorted[i]] = nan
 */
    __pyx_t_17 = __pyx_v_i;
    __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 = 187; __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_17, __pyx_pybuffernd_sorted_data.diminfo[0].strides));

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

      /* "pandas/algos.pyx":189
 *         val = sorted_data[i]
 *         if (val == nan_value) and keep_na:
 *             ranks[argsorted[i]] = nan             # <<<<<<<<<<<<<<
 *             continue
 *         count += 1.0
 */
      __pyx_t_18 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_18 >= __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 = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_19 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_argsorted.diminfo[0].strides));
      __pyx_t_3 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_pybuffernd_ranks.diminfo[0].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_19 >= __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 = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_ranks.diminfo[0].strides) = __pyx_v_6pandas_5algos_nan;

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

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

    /* "pandas/algos.pyx":192
 *             continue
 *         count += 1.0
 *         if i == n - 1 or sorted_data[i + 1] != val:             # <<<<<<<<<<<<<<
 *             if tiebreak == TIEBREAK_AVERAGE:
 *                 for j in range(i - dups + 1, i + 1):
 */
    __pyx_t_14 = ((__pyx_v_i == (__pyx_v_n - 1)) != 0);
    if (!__pyx_t_14) {
    } else {
      __pyx_t_11 = __pyx_t_14;
      goto __pyx_L13_bool_binop_done;
    }
    __pyx_t_20 = (__pyx_v_i + 1);
    __pyx_t_3 = -1;
    if (__pyx_t_20 < 0) {
      __pyx_t_20 += __pyx_pybuffernd_sorted_data.diminfo[0].shape;
      if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0;
    } else if (unlikely(__pyx_t_20 >= __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 = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_sorted_data.diminfo[0].strides)) != __pyx_v_val) != 0);
    __pyx_t_11 = __pyx_t_14;
    __pyx_L13_bool_binop_done:;
    if (__pyx_t_11) {

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

        /* "pandas/algos.pyx":194
 *         if i == n - 1 or 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":195
 *             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 = 195; __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 = 195; __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 = 195; __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_L15;
      }

      /* "pandas/algos.pyx":196
 *                 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_11 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MIN) != 0);
      if (__pyx_t_11) {

        /* "pandas/algos.pyx":197
 *                     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":198
 *             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 = 198; __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 = 198; __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_L15;
      }

      /* "pandas/algos.pyx":199
 *                 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_11 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MAX) != 0);
      if (__pyx_t_11) {

        /* "pandas/algos.pyx":200
 *                     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":201
 *             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 = 201; __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 = 201; __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_L15;
      }

      /* "pandas/algos.pyx":202
 *                 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_11 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0);
      if (__pyx_t_11) {

        /* "pandas/algos.pyx":203
 *                     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":204
 *             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 = 204; __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 = 204; __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_L15;
      }

      /* "pandas/algos.pyx":205
 *                 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_11 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING) != 0);
      if (__pyx_t_11) {

        /* "pandas/algos.pyx":206
 *                     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":207
 *             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 = 207; __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 = 207; __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_L15;
      }

      /* "pandas/algos.pyx":208
 *                 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_11 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0);
      if (__pyx_t_11) {

        /* "pandas/algos.pyx":209
 *                     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":210
 *             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":211
 *                 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 = 211; __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 = 211; __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_L15;
      }
      __pyx_L15:;

      /* "pandas/algos.pyx":212
 *                 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.0;
      __pyx_v_dups = 0;
      goto __pyx_L12;
    }
    __pyx_L12:;
    __pyx_L7_continue:;
  }

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

    /* "pandas/algos.pyx":214
 *             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 = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_ranks), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":216
 *         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":138
 * 
 * 
 * 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_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_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":219
 * 
 * 
 * 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 = {"rank_1d_int64", (PyCFunction)__pyx_pw_6pandas_5algos_3rank_1d_int64, METH_VARARGS|METH_KEYWORDS, __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":220
 * 
 * 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 = 219; __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 = 219; __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":219
 * 
 * 
 * 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;
  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;
  Py_ssize_t __pyx_t_10;
  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;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  __pyx_t_5numpy_int64_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  __pyx_t_5numpy_int64_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_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":226
 * 
 *     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":231
 *         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":232
 *         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":233
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0
 *         float count = 0.0             # <<<<<<<<<<<<<<
 *     tiebreak = tiebreakers[ties_method]
 * 
 */
  __pyx_v_count = 0.0;

  /* "pandas/algos.pyx":234
 *         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 = 234; __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 = 234; __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 = 234; __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":236
 *     tiebreak = tiebreakers[ties_method]
 * 
 *     values = np.asarray(in_arr)             # <<<<<<<<<<<<<<
 * 
 *     n = len(values)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_in_arr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __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 = NULL;
    __Pyx_INCREF(__pyx_v_in_arr);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_in_arr);
    __Pyx_GIVEREF(__pyx_v_in_arr);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __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 = 236; __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, 1, 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_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_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 = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":238
 *     values = np.asarray(in_arr)
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     ranks = np.empty(n, dtype='f8')
 * 
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_10;

  /* "pandas/algos.pyx":239
 * 
 *     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 = 239; __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 = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __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 = 239; __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 = 239; __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 = 239; __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 = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __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_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 = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((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_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_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, 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_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 = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":242
 * 
 *     # 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":244
 *     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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_kind, __pyx_n_s_mergesort) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __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_v__as = __pyx_t_5;
    __pyx_t_5 = 0;

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

      /* "pandas/algos.pyx":246
 *         _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":248
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 *         _as = values.argsort()             # <<<<<<<<<<<<<<
 * 
 *     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 = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_1) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v__as = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L3:;

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

    /* "pandas/algos.pyx":251
 * 
 *     if not ascending:
 *         _as = _as[::-1]             # <<<<<<<<<<<<<<
 * 
 *     sorted_data = values.take(_as)
 */
    __pyx_t_5 = PyObject_GetItem(__pyx_v__as, __pyx_slice__4); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __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_L5;
  }
  __pyx_L5:;

  /* "pandas/algos.pyx":253
 *         _as = _as[::-1]
 * 
 *     sorted_data = values.take(_as)             # <<<<<<<<<<<<<<
 *     argsorted = _as.astype('i8')
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_take); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v__as); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __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 = NULL;
    __Pyx_INCREF(__pyx_v__as);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v__as);
    __Pyx_GIVEREF(__pyx_v__as);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __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_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 = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __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_6, &__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_7, &__pyx_t_8, &__pyx_t_9);
      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_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_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 = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_sorted_data = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":254
 * 
 *     sorted_data = values.take(_as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __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 = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((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_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_9, &__pyx_t_8, &__pyx_t_7);
      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_8); Py_XDECREF(__pyx_t_7);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      }
    }
    __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 = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":256
 *     argsorted = _as.astype('i8')
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         sum_ranks += i + 1
 *         dups += 1
 */
  __pyx_t_10 = __pyx_v_n;
  for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_10; __pyx_t_15+=1) {
    __pyx_v_i = __pyx_t_15;

    /* "pandas/algos.pyx":257
 * 
 *     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":258
 *     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":259
 *         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 = 259; __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":260
 *         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":261
 *         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_13 = ((__pyx_v_i == (__pyx_v_n - 1)) != 0);
    if (!__pyx_t_13) {
    } else {
      __pyx_t_12 = __pyx_t_13;
      goto __pyx_L9_bool_binop_done;
    }
    __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 = 261; __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_12 = __pyx_t_13;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":262
 *         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_12 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE) != 0);
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":263
 *         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_18 = (__pyx_v_i + 1);
        for (__pyx_t_19 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
          __pyx_v_j = __pyx_t_19;

          /* "pandas/algos.pyx":264
 *             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 = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_20 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_20 < 0) {
            __pyx_t_20 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_20 >= __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 = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_21 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_21 < 0) {
            __pyx_t_21 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_21 >= __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 = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_sum_ranks / __pyx_v_dups);
        }
        goto __pyx_L11;
      }

      /* "pandas/algos.pyx":265
 *                 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_12 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MIN) != 0);
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":266
 *                     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_18 = (__pyx_v_i + 1);
        for (__pyx_t_19 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
          __pyx_v_j = __pyx_t_19;

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

      /* "pandas/algos.pyx":268
 *                 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_12 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MAX) != 0);
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":269
 *                     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_18 = (__pyx_v_i + 1);
        for (__pyx_t_19 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
          __pyx_v_j = __pyx_t_19;

          /* "pandas/algos.pyx":270
 *             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_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 = 270; __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 = 270; __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_i + 1);
        }
        goto __pyx_L11;
      }

      /* "pandas/algos.pyx":271
 *                 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_12 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0);
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":272
 *                     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_18 = (__pyx_v_i + 1);
        for (__pyx_t_19 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
          __pyx_v_j = __pyx_t_19;

          /* "pandas/algos.pyx":273
 *             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_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 = 273; __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 = 273; __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_j + 1);
        }
        goto __pyx_L11;
      }

      /* "pandas/algos.pyx":274
 *                 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_12 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING) != 0);
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":275
 *                     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_18 = (__pyx_v_i + 1);
        for (__pyx_t_19 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
          __pyx_v_j = __pyx_t_19;

          /* "pandas/algos.pyx":276
 *             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_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 = 276; __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 = 276; __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) = ((((2 * __pyx_v_i) - __pyx_v_j) - __pyx_v_dups) + 2);
        }
        goto __pyx_L11;
      }

      /* "pandas/algos.pyx":277
 *                 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_12 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0);
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":278
 *                     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":279
 *             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_18 = (__pyx_v_i + 1);
        for (__pyx_t_19 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
          __pyx_v_j = __pyx_t_19;

          /* "pandas/algos.pyx":280
 *                 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 = 280; __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 = 280; __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_L11;
      }
      __pyx_L11:;

      /* "pandas/algos.pyx":281
 *                 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.0;
      __pyx_v_dups = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

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

    /* "pandas/algos.pyx":283
 *             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 = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_ranks), __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __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;
  }
  /*else*/ {

    /* "pandas/algos.pyx":285
 *         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":219
 * 
 * 
 * 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_5);
  { 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":288
 * 
 * 
 * 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 = {"rank_2d_float64", (PyCFunction)__pyx_pw_6pandas_5algos_5rank_2d_float64, METH_VARARGS|METH_KEYWORDS, __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":289
 * 
 * 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 = 288; __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 = 288; __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":288
 * 
 * 
 * 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;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __pyx_t_5numpy_float64_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  PyArrayObject *__pyx_t_18 = NULL;
  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;
  __pyx_t_5numpy_int64_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  __pyx_t_5numpy_int64_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  __pyx_t_5numpy_int64_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  __pyx_t_5numpy_int64_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_int64_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  __pyx_t_5numpy_int64_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  __pyx_t_5numpy_int64_t __pyx_t_54;
  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":295
 * 
 *     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":299
 *         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":300
 *         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":301
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0
 *         bint keep_na = 0             # <<<<<<<<<<<<<<
 *         float count = 0.0
 * 
 */
  __pyx_v_keep_na = 0;

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

  /* "pandas/algos.pyx":304
 *         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 = 304; __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 = 304; __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 = 304; __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":306
 *     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 = 306; __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 = 306; __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":308
 *     keep_na = na_option == 'keep'
 * 
 *     in_arr = np.asarray(in_arr)             # <<<<<<<<<<<<<<
 * 
 *     if axis == 0:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_in_arr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_in_arr);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_in_arr);
    __Pyx_GIVEREF(__pyx_v_in_arr);
    __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 = 308; __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_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_in_arr, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":310
 *     in_arr = np.asarray(in_arr)
 * 
 *     if axis == 0:             # <<<<<<<<<<<<<<
 *         values = in_arr.T.copy()
 *     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 = 310; __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 = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":311
 * 
 *     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 = 311; __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 = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = ((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_7, &__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_8, &__pyx_t_9, &__pyx_t_10);
        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_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_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 = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/algos.pyx":313
 *         values = in_arr.T.copy()
 *     else:
 *         values = in_arr.copy()             # <<<<<<<<<<<<<<
 * 
 *     if ascending ^ (na_option == 'top'):
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_arr, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = ((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_7, &__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_10, &__pyx_t_9, &__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, 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_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 = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

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

    /* "pandas/algos.pyx":316
 * 
 *     if ascending ^ (na_option == 'top'):
 *         nan_value = np.inf             # <<<<<<<<<<<<<<
 *     else:
 *         nan_value = -np.inf
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_nan_value = __pyx_t_11;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/algos.pyx":318
 *         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 = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_nan_value = __pyx_t_11;
  }
  __pyx_L4:;

  /* "pandas/algos.pyx":320
 *         nan_value = -np.inf
 * 
 *     np.putmask(values, np.isnan(values), nan_value)             # <<<<<<<<<<<<<<
 * 
 *     n, k = (<object> values).shape
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __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 = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_isnan); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_12, ((PyObject *)__pyx_v_values)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_values));
    PyTuple_SET_ITEM(__pyx_t_13, 0+1, ((PyObject *)__pyx_v_values));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __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_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyFloat_FromDouble(__pyx_v_nan_value); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = NULL;
  __pyx_t_14 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_13)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_14 = 1;
    }
  }
  __pyx_t_1 = PyTuple_New(3+__pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__pyx_t_13) {
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_14, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_14, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_14, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_6 = 0;
  __pyx_t_12 = 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 = 320; __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":322
 *     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 = 322; __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 = 322; __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_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_1);
    #else
    __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __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_12 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_15 = Py_TYPE(__pyx_t_12)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_15(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_1 = __pyx_t_15(__pyx_t_12); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_15 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L6_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 = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_14;
  __pyx_v_k = __pyx_t_16;

  /* "pandas/algos.pyx":323
 * 
 *     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 = 323; __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[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __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_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_2 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __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_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((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_7, &__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_8, &__pyx_t_9, &__pyx_t_10);
      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_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_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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":325
 *     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":327
 *     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 = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_axis, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_kind, __pyx_n_s_mergesort) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_12); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __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_v__as = __pyx_t_5;
    __pyx_t_5 = 0;

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

      /* "pandas/algos.pyx":329
 *         _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":331
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 *         _as = values.argsort(1)             # <<<<<<<<<<<<<<
 * 
 *     if not ascending:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); 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_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v__as = __pyx_t_12;
    __pyx_t_12 = 0;
  }
  __pyx_L7:;

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

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

  /* "pandas/algos.pyx":336
 *         _as = _as[:, ::-1]
 * 
 *     values = _take_2d_float64(values, _as)             # <<<<<<<<<<<<<<
 *     argsorted = _as.astype('i8')
 * 
 */
  __pyx_t_12 = __pyx_f_6pandas_5algos__take_2d_float64(((PyArrayObject *)__pyx_v_values), __pyx_v__as); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_12);
  {
    __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_7, &__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_10, &__pyx_t_9, &__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, 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_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 = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_12));
  __pyx_t_12 = 0;

  /* "pandas/algos.pyx":337
 * 
 *     values = _take_2d_float64(values, _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 = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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 = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_5);
  {
    __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_18, &__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_8, &__pyx_t_9, &__pyx_t_10);
      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_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_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 = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_18 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":339
 *     argsorted = _as.astype('i8')
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         dups = sum_ranks = 0
 *         total_tie_count = 0
 */
  __pyx_t_16 = __pyx_v_n;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_16; __pyx_t_14+=1) {
    __pyx_v_i = __pyx_t_14;

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

    /* "pandas/algos.pyx":341
 *     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":342
 *         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":343
 *         total_tie_count = 0
 *         count = 0.0
 *         for j in range(k):             # <<<<<<<<<<<<<<
 *             sum_ranks += j + 1
 *             dups += 1
 */
    __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/algos.pyx":344
 *         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":345
 *         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":346
 *             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_21 = __pyx_v_i;
      __pyx_t_22 = __pyx_v_j;
      __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 = 346; __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/algos.pyx":347
 *             dups += 1
 *             val = values[i, j]
 *             if val == nan_value and keep_na:             # <<<<<<<<<<<<<<
 *                 ranks[i, argsorted[i, j]] = nan
 *                 continue
 */
      __pyx_t_17 = ((__pyx_v_val == __pyx_v_nan_value) != 0);
      if (__pyx_t_17) {
      } else {
        __pyx_t_4 = __pyx_t_17;
        goto __pyx_L15_bool_binop_done;
      }
      __pyx_t_17 = (__pyx_v_keep_na != 0);
      __pyx_t_4 = __pyx_t_17;
      __pyx_L15_bool_binop_done:;
      if (__pyx_t_4) {

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

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

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

      /* "pandas/algos.pyx":351
 *                 continue
 *             count += 1.0
 *             if j == k - 1 or values[i, j + 1] != val:             # <<<<<<<<<<<<<<
 *                 if tiebreak == TIEBREAK_AVERAGE:
 *                     for z in range(j - dups + 1, j + 1):
 */
      __pyx_t_17 = ((__pyx_v_j == (__pyx_v_k - 1)) != 0);
      if (!__pyx_t_17) {
      } else {
        __pyx_t_4 = __pyx_t_17;
        goto __pyx_L18_bool_binop_done;
      }
      __pyx_t_27 = __pyx_v_i;
      __pyx_t_28 = (__pyx_v_j + 1);
      __pyx_t_3 = -1;
      if (__pyx_t_27 < 0) {
        __pyx_t_27 += __pyx_pybuffernd_values.diminfo[0].shape;
        if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0;
      if (__pyx_t_28 < 0) {
        __pyx_t_28 += __pyx_pybuffernd_values.diminfo[1].shape;
        if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 1;
      } else if (unlikely(__pyx_t_28 >= __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 = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_17 = (((*__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)) != __pyx_v_val) != 0);
      __pyx_t_4 = __pyx_t_17;
      __pyx_L18_bool_binop_done:;
      if (__pyx_t_4) {

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

          /* "pandas/algos.pyx":353
 *             if j == k - 1 or 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_29 = (__pyx_v_j + 1);
          for (__pyx_t_30 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) {
            __pyx_v_z = __pyx_t_30;

            /* "pandas/algos.pyx":354
 *                 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 = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_31 = __pyx_v_i;
            __pyx_t_32 = __pyx_v_z;
            __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 (__pyx_t_32 < 0) {
              __pyx_t_32 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_32 >= __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 = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_33 = __pyx_v_i;
            __pyx_t_34 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_33 < 0) {
              __pyx_t_33 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_34 < 0) {
              __pyx_t_34 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_34 >= __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 = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_sum_ranks / __pyx_v_dups);
          }
          goto __pyx_L20;
        }

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

          /* "pandas/algos.pyx":356
 *                         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_29 = (__pyx_v_j + 1);
          for (__pyx_t_30 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) {
            __pyx_v_z = __pyx_t_30;

            /* "pandas/algos.pyx":357
 *                 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_35 = __pyx_v_i;
            __pyx_t_36 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_35 < 0) {
              __pyx_t_35 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_36 < 0) {
              __pyx_t_36 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_36 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_36 >= __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 = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_37 = __pyx_v_i;
            __pyx_t_38 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_37 < 0) {
              __pyx_t_37 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_37 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_38 < 0) {
              __pyx_t_38 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_38 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_38 >= __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 = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((__pyx_v_j - __pyx_v_dups) + 2);
          }
          goto __pyx_L20;
        }

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

          /* "pandas/algos.pyx":359
 *                         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_29 = (__pyx_v_j + 1);
          for (__pyx_t_30 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) {
            __pyx_v_z = __pyx_t_30;

            /* "pandas/algos.pyx":360
 *                 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_39 = __pyx_v_i;
            __pyx_t_40 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_39 < 0) {
              __pyx_t_39 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_39 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_40 < 0) {
              __pyx_t_40 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_40 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_40 >= __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 = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_41 = __pyx_v_i;
            __pyx_t_42 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_41 < 0) {
              __pyx_t_41 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_41 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_42 < 0) {
              __pyx_t_42 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_42 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_42 >= __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 = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_j + 1);
          }
          goto __pyx_L20;
        }

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

          /* "pandas/algos.pyx":362
 *                         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_29 = (__pyx_v_j + 1);
          for (__pyx_t_30 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) {
            __pyx_v_z = __pyx_t_30;

            /* "pandas/algos.pyx":363
 *                 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_43 = __pyx_v_i;
            __pyx_t_44 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_43 < 0) {
              __pyx_t_43 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_43 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_44 < 0) {
              __pyx_t_44 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_44 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_44 >= __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 = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_45 = __pyx_v_i;
            __pyx_t_46 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_45 < 0) {
              __pyx_t_45 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_45 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_46 < 0) {
              __pyx_t_46 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_46 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_46 >= __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 = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_z + 1);
          }
          goto __pyx_L20;
        }

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

          /* "pandas/algos.pyx":365
 *                         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_29 = (__pyx_v_j + 1);
          for (__pyx_t_30 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) {
            __pyx_v_z = __pyx_t_30;

            /* "pandas/algos.pyx":366
 *                 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_47 = __pyx_v_i;
            __pyx_t_48 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_47 < 0) {
              __pyx_t_47 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_47 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_48 < 0) {
              __pyx_t_48 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_48 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_48 >= __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 = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_49 = __pyx_v_i;
            __pyx_t_50 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_49 < 0) {
              __pyx_t_49 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_49 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_50 < 0) {
              __pyx_t_50 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_50 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_50 >= __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 = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((((2 * __pyx_v_j) - __pyx_v_z) - __pyx_v_dups) + 2);
          }
          goto __pyx_L20;
        }

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

          /* "pandas/algos.pyx":368
 *                         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":369
 *                 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_29 = (__pyx_v_j + 1);
          for (__pyx_t_30 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) {
            __pyx_v_z = __pyx_t_30;

            /* "pandas/algos.pyx":370
 *                     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_51 = __pyx_v_i;
            __pyx_t_52 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_51 < 0) {
              __pyx_t_51 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_51 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_52 < 0) {
              __pyx_t_52 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_52 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_52 >= __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_53 = __pyx_v_i;
            __pyx_t_54 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_53 < 0) {
              __pyx_t_53 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_53 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_54 < 0) {
              __pyx_t_54 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_54 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_54 >= __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_53, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_54, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_total_tie_count;
          }
          goto __pyx_L20;
        }
        __pyx_L20:;

        /* "pandas/algos.pyx":371
 *                     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.0;
        __pyx_v_dups = 0;
        goto __pyx_L17;
      }
      __pyx_L17:;
      __pyx_L12_continue:;
    }

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

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

  /* "pandas/algos.pyx":374
 *         if pct:
 *             ranks[i, :] /= count
 *     if axis == 0:             # <<<<<<<<<<<<<<
 *         return ranks.T
 *     else:
 */
  __pyx_t_12 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __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[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__pyx_t_4) {

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

    /* "pandas/algos.pyx":377
 *         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":288
 * 
 * 
 * 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_6);
  __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_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":380
 * 
 * 
 * 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 = {"rank_2d_int64", (PyCFunction)__pyx_pw_6pandas_5algos_7rank_2d_int64, METH_VARARGS|METH_KEYWORDS, __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":381
 * 
 * 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 = 380; __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 = 380; __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":380
 * 
 * 
 * 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;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__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;
  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;
  __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;
  __pyx_t_5numpy_int64_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  __pyx_t_5numpy_int64_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_int64_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  __pyx_t_5numpy_int64_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  __pyx_t_5numpy_int64_t __pyx_t_48;
  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":387
 * 
 *     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":392
 *         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":393
 *         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":394
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0
 *         float count = 0.0             # <<<<<<<<<<<<<<
 *     tiebreak = tiebreakers[ties_method]
 * 
 */
  __pyx_v_count = 0.0;

  /* "pandas/algos.pyx":395
 *         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 = 395; __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 = 395; __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 = 395; __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":397
 *     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 = 397; __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 = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":398
 * 
 *     if axis == 0:
 *         values = np.asarray(in_arr).T             # <<<<<<<<<<<<<<
 *     else:
 *         values = np.asarray(in_arr)
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_in_arr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_INCREF(__pyx_v_in_arr);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_in_arr);
      __Pyx_GIVEREF(__pyx_v_in_arr);
      __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 = 398; __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_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_T); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __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 = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = ((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_7, &__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_8, &__pyx_t_9, &__pyx_t_10);
        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_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_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 = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/algos.pyx":400
 *         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 = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_2) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_in_arr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __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 = NULL;
      __Pyx_INCREF(__pyx_v_in_arr);
      PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_in_arr);
      __Pyx_GIVEREF(__pyx_v_in_arr);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __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_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 = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = ((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_7, &__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_10, &__pyx_t_9, &__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, 2, 1, __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_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 = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "pandas/algos.pyx":402
 *         values = np.asarray(in_arr)
 * 
 *     n, k = (<object> values).shape             # <<<<<<<<<<<<<<
 *     ranks = np.empty((n, k), dtype='f8')
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __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[0]; __pyx_lineno = 402; __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_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_1);
    #else
    __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_11(__pyx_t_2); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_1 = __pyx_t_11(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = NULL;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __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 = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_12;
  __pyx_v_k = __pyx_t_13;

  /* "pandas/algos.pyx":403
 * 
 *     n, k = (<object> values).shape
 *     ranks = np.empty((n, k), dtype='f8')             # <<<<<<<<<<<<<<
 * 
 *     if tiebreak == TIEBREAK_FIRST:
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __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 = 403; __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_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __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);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __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 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __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 = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __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_6); __pyx_t_6 = 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 = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_5);
  {
    __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_8, &__pyx_t_9, &__pyx_t_10);
      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_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_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 = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

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

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

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

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

    /* "pandas/algos.pyx":414
 * 
 *     if not ascending:
 *         _as = _as[:, ::-1]             # <<<<<<<<<<<<<<
 * 
 *     values = _take_2d_int64(values, _as)
 */
    __pyx_t_2 = PyObject_GetItem(__pyx_v__as, __pyx_tuple__15); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __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_L8;
  }
  __pyx_L8:;

  /* "pandas/algos.pyx":416
 *         _as = _as[:, ::-1]
 * 
 *     values = _take_2d_int64(values, _as)             # <<<<<<<<<<<<<<
 *     argsorted = _as.astype('i8')
 * 
 */
  __pyx_t_2 = __pyx_f_6pandas_5algos__take_2d_int64(((PyArrayObject *)__pyx_v_values), __pyx_v__as); 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);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((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_7, &__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_10, &__pyx_t_9, &__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, 2, 1, __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_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 = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":417
 * 
 *     values = _take_2d_int64(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 = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_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 = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_16 = ((PyArrayObject *)__pyx_t_6);
  {
    __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_8, &__pyx_t_9, &__pyx_t_10);
      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_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_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 = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_16 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

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

    /* "pandas/algos.pyx":421
 *     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":422
 *         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":423
 *         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":424
 *         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":425
 *         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":426
 *             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 = 426; __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":427
 *             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":428
 *             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_15 = ((__pyx_v_j == (__pyx_v_k - 1)) != 0);
      if (!__pyx_t_15) {
      } else {
        __pyx_t_4 = __pyx_t_15;
        goto __pyx_L14_bool_binop_done;
      }
      __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 = 428; __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_4 = __pyx_t_15;
      __pyx_L14_bool_binop_done:;
      if (__pyx_t_4) {

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

          /* "pandas/algos.pyx":430
 *             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_23 = (__pyx_v_j + 1);
          for (__pyx_t_24 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
            __pyx_v_z = __pyx_t_24;

            /* "pandas/algos.pyx":431
 *                 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 = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_25 = __pyx_v_i;
            __pyx_t_26 = __pyx_v_z;
            __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 (__pyx_t_26 < 0) {
              __pyx_t_26 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_26 >= __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 = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_27 = __pyx_v_i;
            __pyx_t_28 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_argsorted.diminfo[1].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 (__pyx_t_28 < 0) {
              __pyx_t_28 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_28 >= __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 = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_sum_ranks / __pyx_v_dups);
          }
          goto __pyx_L16;
        }

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

          /* "pandas/algos.pyx":433
 *                         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_23 = (__pyx_v_j + 1);
          for (__pyx_t_24 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
            __pyx_v_z = __pyx_t_24;

            /* "pandas/algos.pyx":434
 *                 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_29 = __pyx_v_i;
            __pyx_t_30 = __pyx_v_z;
            __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 (__pyx_t_30 < 0) {
              __pyx_t_30 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_30 >= __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 = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_31 = __pyx_v_i;
            __pyx_t_32 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_argsorted.diminfo[1].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 (__pyx_t_32 < 0) {
              __pyx_t_32 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_32 >= __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 = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((__pyx_v_j - __pyx_v_dups) + 2);
          }
          goto __pyx_L16;
        }

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

          /* "pandas/algos.pyx":436
 *                         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_23 = (__pyx_v_j + 1);
          for (__pyx_t_24 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
            __pyx_v_z = __pyx_t_24;

            /* "pandas/algos.pyx":437
 *                 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_33 = __pyx_v_i;
            __pyx_t_34 = __pyx_v_z;
            __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 (__pyx_t_34 < 0) {
              __pyx_t_34 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_34 >= __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 = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_35 = __pyx_v_i;
            __pyx_t_36 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_35 < 0) {
              __pyx_t_35 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_36 < 0) {
              __pyx_t_36 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_36 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_36 >= __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 = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_j + 1);
          }
          goto __pyx_L16;
        }

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

          /* "pandas/algos.pyx":439
 *                         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_23 = (__pyx_v_j + 1);
          for (__pyx_t_24 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
            __pyx_v_z = __pyx_t_24;

            /* "pandas/algos.pyx":440
 *                 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_37 = __pyx_v_i;
            __pyx_t_38 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_37 < 0) {
              __pyx_t_37 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_37 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_38 < 0) {
              __pyx_t_38 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_38 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_38 >= __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 = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_39 = __pyx_v_i;
            __pyx_t_40 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_39 < 0) {
              __pyx_t_39 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_39 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_40 < 0) {
              __pyx_t_40 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_40 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_40 >= __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 = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_z + 1);
          }
          goto __pyx_L16;
        }

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

          /* "pandas/algos.pyx":442
 *                         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_23 = (__pyx_v_j + 1);
          for (__pyx_t_24 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
            __pyx_v_z = __pyx_t_24;

            /* "pandas/algos.pyx":443
 *                 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_41 = __pyx_v_i;
            __pyx_t_42 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_41 < 0) {
              __pyx_t_41 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_41 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_42 < 0) {
              __pyx_t_42 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_42 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_42 >= __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 = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_43 = __pyx_v_i;
            __pyx_t_44 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_43 < 0) {
              __pyx_t_43 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_43 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_44 < 0) {
              __pyx_t_44 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_44 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_44 >= __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 = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((((2 * __pyx_v_j) - __pyx_v_z) - __pyx_v_dups) + 2);
          }
          goto __pyx_L16;
        }

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

          /* "pandas/algos.pyx":445
 *                         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":446
 *                 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_23 = (__pyx_v_j + 1);
          for (__pyx_t_24 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
            __pyx_v_z = __pyx_t_24;

            /* "pandas/algos.pyx":447
 *                     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_45 = __pyx_v_i;
            __pyx_t_46 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_45 < 0) {
              __pyx_t_45 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
              if (unlikely(__pyx_t_45 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_46 < 0) {
              __pyx_t_46 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
              if (unlikely(__pyx_t_46 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_46 >= __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_47 = __pyx_v_i;
            __pyx_t_48 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_argsorted.diminfo[1].strides));
            __pyx_t_3 = -1;
            if (__pyx_t_47 < 0) {
              __pyx_t_47 += __pyx_pybuffernd_ranks.diminfo[0].shape;
              if (unlikely(__pyx_t_47 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0;
            if (__pyx_t_48 < 0) {
              __pyx_t_48 += __pyx_pybuffernd_ranks.diminfo[1].shape;
              if (unlikely(__pyx_t_48 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_48 >= __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_47, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_total_tie_count;
          }
          goto __pyx_L16;
        }
        __pyx_L16:;

        /* "pandas/algos.pyx":448
 *                     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.0;
        __pyx_v_dups = 0;
        goto __pyx_L13;
      }
      __pyx_L13:;
    }

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

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

  /* "pandas/algos.pyx":451
 *         if pct:
 *             ranks[i, :] /= count
 *     if axis == 0:             # <<<<<<<<<<<<<<
 *         return ranks.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 = 451; __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 = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

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

    /* "pandas/algos.pyx":454
 *         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":380
 * 
 * 
 * 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_6);
  { 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":457
 * 
 * 
 * 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 = {"rank_1d_generic", (PyCFunction)__pyx_pw_6pandas_5algos_9rank_1d_generic, METH_VARARGS|METH_KEYWORDS, __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":458
 * 
 * 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 = 457; __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 = 457; __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 = 457; __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":457
 * 
 * 
 * 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;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  PyArrayObject *__pyx_t_19 = NULL;
  Py_ssize_t __pyx_t_20;
  int __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  __pyx_t_5numpy_int64_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_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;
  Py_ssize_t __pyx_t_32;
  __pyx_t_5numpy_int64_t __pyx_t_33;
  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":464
 * 
 *     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":469
 *         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":470
 *         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":471
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0
 *         bint keep_na = 0             # <<<<<<<<<<<<<<
 *         float count = 0.0
 * 
 */
  __pyx_v_keep_na = 0;

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

  /* "pandas/algos.pyx":475
 * 
 * 
 *     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 = 475; __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 = 475; __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 = 475; __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":477
 *     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 = 477; __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 = 477; __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":479
 *     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 = 479; __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 = 479; __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 = 479; __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 = 479; __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 = 479; __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 = 479; __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 = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_values = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/algos.pyx":481
 *     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 = 481; __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 = 481; __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 = 481; __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 = 481; __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 = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":482
 * 
 *     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 = 482; __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 = 482; __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 = 482; __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":484
 *         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 = 484; __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 = 484; __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 = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":486
 *     if ascending ^ (na_option == 'top'):
 *         # always greater than everything
 *         nan_value = Infinity()             # <<<<<<<<<<<<<<
 *     else:
 *         nan_value = NegInfinity()
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Infinity); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __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;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/algos.pyx":488
 *         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 = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __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":490
 *         nan_value = NegInfinity()
 * 
 *     mask = lib.isnullobj(values)             # <<<<<<<<<<<<<<
 *     np.putmask(values, mask, nan_value)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isnullobj); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_values)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
  } else {
    __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_values));
    PyTuple_SET_ITEM(__pyx_t_1, 0+1, ((PyObject *)__pyx_v_values));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __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_6); __pyx_t_6 = 0;
  __pyx_v_mask = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":491
 * 
 *     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 = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_putmask); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_2 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (__pyx_t_6) {
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_7, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  __Pyx_INCREF(__pyx_v_mask);
  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_7, __pyx_v_mask);
  __Pyx_GIVEREF(__pyx_v_mask);
  __Pyx_INCREF(__pyx_v_nan_value);
  PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_7, __pyx_v_nan_value);
  __Pyx_GIVEREF(__pyx_v_nan_value);
  __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 = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

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

  /* "pandas/algos.pyx":494
 * 
 *     n = len(values)
 *     ranks = np.empty(n, dtype='f8')             # <<<<<<<<<<<<<<
 * 
 *     # py2.5/win32 hack, can't pass i8
 */
  __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_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __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_n); 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 = PyTuple_New(1); 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);
  PyTuple_SET_ITEM(__pyx_t_2, 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 = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __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 = 494; __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 = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_6);
  {
    __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 = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/algos.pyx":497
 * 
 *     # 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":498
 *     # py2.5/win32 hack, can't pass i8
 *     try:
 *         _as = values.argsort()             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         if not retry:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_2) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v__as = __pyx_t_6;
      __pyx_t_6 = 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_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

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

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

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

      /* "pandas/algos.pyx":503
 *             raise
 * 
 *         valid_locs = (~mask).nonzero()[0]             # <<<<<<<<<<<<<<
 *         ranks.put(valid_locs, rank_1d_generic(values.take(valid_locs), 0,
 *                                               ties_method=ties_method,
 */
      __pyx_t_12 = PyNumber_Invert(__pyx_v_mask); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_nonzero); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_13, function);
        }
      }
      if (__pyx_t_12) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;};
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_valid_locs = __pyx_t_13;
      __pyx_t_13 = 0;

      /* "pandas/algos.pyx":504
 * 
 *         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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ranks), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_rank_1d_generic); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_take); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_16 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_15))) {
        __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15);
        if (likely(__pyx_t_16)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
          __Pyx_INCREF(__pyx_t_16);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_15, function);
        }
      }
      if (!__pyx_t_16) {
        __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_v_valid_locs); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(__pyx_t_14);
      } else {
        __pyx_t_17 = PyTuple_New(1+1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(__pyx_t_17);
        PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
        __Pyx_INCREF(__pyx_v_valid_locs);
        PyTuple_SET_ITEM(__pyx_t_17, 0+1, __pyx_v_valid_locs);
        __Pyx_GIVEREF(__pyx_v_valid_locs);
        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_17, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 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 = 504; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_15);
      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      __pyx_t_14 = 0;
      __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_14);

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

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

      /* "pandas/algos.pyx":504
 * 
 *         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_17 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_15, __pyx_t_14); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_14)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_15 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_15);
      if (__pyx_t_14) {
        PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = NULL;
      }
      __Pyx_INCREF(__pyx_v_valid_locs);
      PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_7, __pyx_v_valid_locs);
      __Pyx_GIVEREF(__pyx_v_valid_locs);
      PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_7, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_17);
      __pyx_t_17 = 0;
      __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_15, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

      /* "pandas/algos.pyx":507
 *                                               ties_method=ties_method,
 *                                               ascending=ascending))
 *         np.putmask(ranks, mask, np.nan)             # <<<<<<<<<<<<<<
 *         return ranks
 * 
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_putmask); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __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 = 507; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_15);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_15, function);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_14 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_14);
      if (__pyx_t_1) {
        PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_ranks));
      PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_7, ((PyObject *)__pyx_v_ranks));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_ranks));
      __Pyx_INCREF(__pyx_v_mask);
      PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_7, __pyx_v_mask);
      __Pyx_GIVEREF(__pyx_v_mask);
      PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_7, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_17);
      __pyx_t_17 = 0;
      __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

      /* "pandas/algos.pyx":508
 *                                               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_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L8_except_return;
    }
    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_L12_try_end:;
  }

  /* "pandas/algos.pyx":510
 *         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 = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_18 = ((!__pyx_t_4) != 0);
  if (__pyx_t_18) {

    /* "pandas/algos.pyx":511
 * 
 *     if not ascending:
 *         _as = _as[::-1]             # <<<<<<<<<<<<<<
 * 
 *     sorted_data = values.take(_as)
 */
    __pyx_t_2 = PyObject_GetItem(__pyx_v__as, __pyx_slice__19); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __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_L16;
  }
  __pyx_L16:;

  /* "pandas/algos.pyx":513
 *         _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 = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v__as); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(__pyx_v__as);
    PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_v__as);
    __Pyx_GIVEREF(__pyx_v__as);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __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_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 = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_sorted_data = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":514
 * 
 *     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 = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __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 = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_19 = ((PyArrayObject *)__pyx_t_5);
  {
    __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_19, &__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 = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_19 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":515
 *     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_20 = 0; __pyx_t_20 < __pyx_t_7; __pyx_t_20+=1) {
    __pyx_v_i = __pyx_t_20;

    /* "pandas/algos.pyx":516
 *     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":517
 *     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":518
 *         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_5 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __pyx_f_4util_get_value_at(__pyx_v_sorted_data, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/algos.pyx":519
 *         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_4 = (__pyx_v_val == __pyx_v_nan_value);
    __pyx_t_21 = (__pyx_t_4 != 0);
    if (__pyx_t_21) {
    } else {
      __pyx_t_18 = __pyx_t_21;
      goto __pyx_L20_bool_binop_done;
    }
    __pyx_t_21 = (__pyx_v_keep_na != 0);
    __pyx_t_18 = __pyx_t_21;
    __pyx_L20_bool_binop_done:;
    if (__pyx_t_18) {

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

      /* "pandas/algos.pyx":521
 *         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":522
 *             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_21 = ((__pyx_v_i == (__pyx_v_n - 1)) != 0);
    if (!__pyx_t_21) {
    } else {
      __pyx_t_18 = __pyx_t_21;
      goto __pyx_L23_bool_binop_done;
    }

    /* "pandas/algos.pyx":523
 *             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 = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_f_4util_get_value_at(__pyx_v_sorted_data, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __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_t_2 = __pyx_f_6pandas_5algos_are_diff(__pyx_t_5, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_21 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_18 = __pyx_t_21;
    __pyx_L23_bool_binop_done:;
    if (__pyx_t_18) {

      /* "pandas/algos.pyx":524
 *         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":525
 *             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_18 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE) != 0);
      if (__pyx_t_18) {

        /* "pandas/algos.pyx":526
 *             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_24 = (__pyx_v_i + 1);
        for (__pyx_t_25 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
          __pyx_v_j = __pyx_t_25;

          /* "pandas/algos.pyx":527
 *             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 = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __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 = 527; __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 = 527; __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_sum_ranks / __pyx_v_dups);
        }
        goto __pyx_L25;
      }

      /* "pandas/algos.pyx":528
 *                 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":529
 *                     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_24 = (__pyx_v_i + 1);
        for (__pyx_t_25 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
          __pyx_v_j = __pyx_t_25;

          /* "pandas/algos.pyx":530
 *             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_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 = 530; __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 = 530; __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 - __pyx_v_dups) + 2);
        }
        goto __pyx_L25;
      }

      /* "pandas/algos.pyx":531
 *                 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":532
 *                     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_24 = (__pyx_v_i + 1);
        for (__pyx_t_25 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
          __pyx_v_j = __pyx_t_25;

          /* "pandas/algos.pyx":533
 *             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_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 = 533; __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 = 533; __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_i + 1);
        }
        goto __pyx_L25;
      }

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

        /* "pandas/algos.pyx":535
 *                     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 = 535; __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 = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }

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

        /* "pandas/algos.pyx":537
 *                 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":538
 *             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_24 = (__pyx_v_i + 1);
        for (__pyx_t_25 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
          __pyx_v_j = __pyx_t_25;

          /* "pandas/algos.pyx":539
 *                 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_32 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_32 < 0) {
            __pyx_t_32 += __pyx_pybuffernd_argsorted.diminfo[0].shape;
            if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_32 >= __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 = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_33 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_argsorted.diminfo[0].strides));
          __pyx_t_3 = -1;
          if (__pyx_t_33 < 0) {
            __pyx_t_33 += __pyx_pybuffernd_ranks.diminfo[0].shape;
            if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_33 >= __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 = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_ranks.diminfo[0].strides) = __pyx_v_total_tie_count;
        }
        goto __pyx_L25;
      }
      __pyx_L25:;

      /* "pandas/algos.pyx":540
 *                 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.0;
      __pyx_v_dups = 0;
      goto __pyx_L22;
    }
    __pyx_L22:;
    __pyx_L17_continue:;
  }

  /* "pandas/algos.pyx":541
 *                     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 = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_18) {

    /* "pandas/algos.pyx":542
 *             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 = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_ranks), __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __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;
  }
  /*else*/ {

    /* "pandas/algos.pyx":544
 *         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":457
 * 
 * 
 * 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);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  { 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":546
 *         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":547
 * 
 * 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":548
 * 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 = 548; __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 = 548; __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 = 548; __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_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pandas/algos.pyx":549
 *     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 = 549; __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":550
 *         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 = 550; __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;
    }
    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;
  }

  /* "pandas/algos.pyx":546
 *         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":575
 *     __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 = {"rank_2d_generic", (PyCFunction)__pyx_pw_6pandas_5algos_11rank_2d_generic, METH_VARARGS|METH_KEYWORDS, __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":576
 * 
 * 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 = 575; __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 = 575; __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":575
 *     __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;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  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;
  int __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  __pyx_t_5numpy_int64_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;
  __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":582
 * 
 *     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":583
 *     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":588
 *         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":589
 *         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":590
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0
 *         bint keep_na = 0             # <<<<<<<<<<<<<<
 *         float count = 0.0
 * 
 */
  __pyx_v_keep_na = 0;

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

  /* "pandas/algos.pyx":593
 *         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 = 593; __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 = 593; __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 = 593; __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":595
 *     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 = 595; __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 = 595; __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":597
 *     keep_na = na_option == 'keep'
 * 
 *     in_arr = np.asarray(in_arr)             # <<<<<<<<<<<<<<
 * 
 *     if axis == 0:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_in_arr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_in_arr);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_in_arr);
    __Pyx_GIVEREF(__pyx_v_in_arr);
    __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 = 597; __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_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_in_arr, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/algos.pyx":599
 *     in_arr = np.asarray(in_arr)
 * 
 *     if axis == 0:             # <<<<<<<<<<<<<<
 *         values = in_arr.T.copy()
 *     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 = 599; __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 = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":600
 * 
 *     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 = 600; __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 = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = ((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_7, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        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_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_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 = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/algos.pyx":602
 *         values = in_arr.T.copy()
 *     else:
 *         values = in_arr.copy()             # <<<<<<<<<<<<<<
 * 
 *     if values.dtype != np.object_:
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_arr, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = ((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_7, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
        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_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_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 = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "pandas/algos.pyx":604
 *         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 = 604; __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[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":605
 * 
 *     if values.dtype != np.object_:
 *         values = values.astype('O')             # <<<<<<<<<<<<<<
 * 
 *     if ascending ^ (na_option == 'top'):
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __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 = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = ((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_7, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        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_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_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 = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

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

    /* "pandas/algos.pyx":609
 *     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 = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_nan_value = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pandas/algos.pyx":611
 *         nan_value = Infinity()
 *     else:
 *         nan_value = NegInfinity()             # <<<<<<<<<<<<<<
 * 
 *     mask = lib.isnullobj2d(values)
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_NegInfinity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_nan_value = __pyx_t_6;
    __pyx_t_6 = 0;
  }
  __pyx_L5:;

  /* "pandas/algos.pyx":613
 *         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 = 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_isnullobj2d); 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 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_values)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_values));
    PyTuple_SET_ITEM(__pyx_t_1, 0+1, ((PyObject *)__pyx_v_values));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __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_v_mask = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "pandas/algos.pyx":614
 * 
 *     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 = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_putmask); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_11 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_11 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_2) {
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_11, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  __Pyx_INCREF(__pyx_v_mask);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_11, __pyx_v_mask);
  __Pyx_GIVEREF(__pyx_v_mask);
  __Pyx_INCREF(__pyx_v_nan_value);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_11, __pyx_v_nan_value);
  __Pyx_GIVEREF(__pyx_v_nan_value);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __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_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":616
 *     np.putmask(values, mask, nan_value)
 * 
 *     n, k = (<object> values).shape             # <<<<<<<<<<<<<<
 *     ranks = np.empty((n, k), dtype='f8')
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __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[0]; __pyx_lineno = 616; __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 = 616; __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 = 616; __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_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_5 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_12 = NULL;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_12 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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 = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_n = __pyx_t_11;
  __pyx_v_k = __pyx_t_13;

  /* "pandas/algos.pyx":617
 * 
 *     n, k = (<object> values).shape
 *     ranks = np.empty((n, k), dtype='f8')             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); 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_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 = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_k); 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_t_2 = PyTuple_New(2); 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);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_6 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); 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);
  PyTuple_SET_ITEM(__pyx_t_1, 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 = 617; __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 = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __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_1); __pyx_t_1 = 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 = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_6);
  {
    __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_10, &__pyx_t_9, &__pyx_t_8);
      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_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_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 = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/algos.pyx":619
 *     ranks = np.empty((n, k), dtype='f8')
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         _as = values.argsort(1)
 *     except TypeError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    /*try:*/ {

      /* "pandas/algos.pyx":620
 * 
 *     try:
 *         _as = values.argsort(1)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         values = in_arr
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v__as = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L15_try_end;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/algos.pyx":621
 *     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_2, &__pyx_t_6, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_1);

      /* "pandas/algos.pyx":622
 *         _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 = 622; __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 = 622; __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":623
 *     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 = 623; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_13; __pyx_t_11+=1) {
        __pyx_v_i = __pyx_t_11;

        /* "pandas/algos.pyx":624
 *         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 = 624; __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 = 624; __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 = 624; __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 = 624; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_18);

        /* "pandas/algos.pyx":625
 *         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 = 624; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}

        /* "pandas/algos.pyx":626
 *             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 = 624; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}

        /* "pandas/algos.pyx":627
 *                                        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 = 624; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}

        /* "pandas/algos.pyx":624
 *         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 = 624; __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 = 624; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      }

      /* "pandas/algos.pyx":628
 *                                        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 = 628; __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 = 628; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      if (__pyx_t_4) {

        /* "pandas/algos.pyx":629
 *                                        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 = 629; __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_6); __pyx_t_6 = 0;
        goto __pyx_L11_except_return;
      }
      /*else*/ {

        /* "pandas/algos.pyx":631
 *             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_6); __pyx_t_6 = 0;
        goto __pyx_L11_except_return;
      }
    }
    goto __pyx_L10_except_error;
    __pyx_L10_except_error:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L1_error;
    __pyx_L11_except_return:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L0;
    __pyx_L15_try_end:;
  }

  /* "pandas/algos.pyx":633
 *             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 = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((!__pyx_t_4) != 0);
  if (__pyx_t_21) {

    /* "pandas/algos.pyx":634
 * 
 *     if not ascending:
 *         _as = _as[:, ::-1]             # <<<<<<<<<<<<<<
 * 
 *     values = _take_2d_object(values, _as)
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v__as, __pyx_tuple__26); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __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_L21;
  }
  __pyx_L21:;

  /* "pandas/algos.pyx":636
 *         _as = _as[:, ::-1]
 * 
 *     values = _take_2d_object(values, _as)             # <<<<<<<<<<<<<<
 *     argsorted = _as.astype('i8')
 * 
 */
  __pyx_t_1 = __pyx_f_6pandas_5algos__take_2d_object(((PyArrayObject *)__pyx_v_values), __pyx_v__as); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __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[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((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_7, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      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_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_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 = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":637
 * 
 *     values = _take_2d_object(values, _as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_22 = ((PyArrayObject *)__pyx_t_6);
  {
    __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_8, &__pyx_t_9, &__pyx_t_10);
      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_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_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 = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_22 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/algos.pyx":639
 *     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_11 = 0; __pyx_t_11 < __pyx_t_13; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "pandas/algos.pyx":640
 * 
 *     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.0;
    __pyx_v_infs = 0;

    /* "pandas/algos.pyx":641
 *     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":642
 *         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":643
 *         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":644
 *         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 = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = (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_6);
      __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "pandas/algos.pyx":645
 *         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_4 = (__pyx_v_val == __pyx_v_nan_value);
      __pyx_t_27 = (__pyx_t_4 != 0);
      if (__pyx_t_27) {
      } else {
        __pyx_t_21 = __pyx_t_27;
        goto __pyx_L27_bool_binop_done;
      }
      __pyx_t_27 = (__pyx_v_keep_na != 0);
      __pyx_t_21 = __pyx_t_27;
      __pyx_L27_bool_binop_done:;
      if (__pyx_t_21) {

        /* "pandas/algos.pyx":646
 *             val = values[i, j]
 *             if val is nan_value and keep_na:
 *                 ranks[i, argsorted[i, j]] = nan             # <<<<<<<<<<<<<<
 *                 infs += 1
 *                 continue
 */
        __pyx_t_28 = __pyx_v_i;
        __pyx_t_29 = __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 (__pyx_t_29 < 0) {
          __pyx_t_29 += __pyx_pybuffernd_argsorted.diminfo[1].shape;
          if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 1;
        } else if (unlikely(__pyx_t_29 >= __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 = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_30 = __pyx_v_i;
        __pyx_t_31 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_argsorted.diminfo[1].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 (__pyx_t_31 < 0) {
          __pyx_t_31 += __pyx_pybuffernd_ranks.diminfo[1].shape;
          if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 1;
        } else if (unlikely(__pyx_t_31 >= __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 = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;

        /* "pandas/algos.pyx":647
 *             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":648
 *                 ranks[i, argsorted[i, j]] = nan
 *                 infs += 1
 *                 continue             # <<<<<<<<<<<<<<
 *             count += 1.0
 *             sum_ranks += (j - infs) + 1
 */
        goto __pyx_L24_continue;
      }

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

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

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

          /* "pandas/algos.pyx":654
 *             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":655
 *                 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 = 655; __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 = 655; __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 = 655; __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_L32;
        }

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

          /* "pandas/algos.pyx":657
 *                         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":658
 *                 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 = 658; __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 = 658; __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_L32;
        }

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

          /* "pandas/algos.pyx":660
 *                         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":661
 *                 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 = 661; __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 = 661; __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_L32;
        }

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

          /* "pandas/algos.pyx":663
 *                         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_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_Raise(__pyx_t_1, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }

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

          /* "pandas/algos.pyx":666
 *                                      '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":667
 *                 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":668
 *                     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 = 668; __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 = 668; __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_L32;
        }
        __pyx_L32:;

        /* "pandas/algos.pyx":669
 *                     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.0;
        __pyx_v_dups = 0;
        goto __pyx_L29;
      }
      __pyx_L29:;
      __pyx_L24_continue:;
    }

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

      /* "pandas/algos.pyx":671
 *                 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 = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_slice__29);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__29);
      __Pyx_GIVEREF(__pyx_slice__29);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_ranks), __pyx_t_6); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __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 = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_20 = __Pyx_PyNumber_InPlaceDivide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __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_6, __pyx_t_20) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L41;
    }
    __pyx_L41:;
  }

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

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

    /* "pandas/algos.pyx":675
 *         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":575
 *     __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_6);
  __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":702
 * # -
 * 
 * def _check_minp(win, minp, N, floor=1):             # <<<<<<<<<<<<<<
 *     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 = {"_check_minp", (PyCFunction)__pyx_pw_6pandas_5algos_13_check_minp, METH_VARARGS|METH_KEYWORDS, 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;
  PyObject *__pyx_v_floor = 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,&__pyx_n_s_floor,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)__pyx_int_1);
    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_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", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __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", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_floor);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      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 = 702; __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_win = values[0];
    __pyx_v_minp = values[1];
    __pyx_v_N = values[2];
    __pyx_v_floor = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_minp", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __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, __pyx_v_floor);

  /* 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_v_floor) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_minp", 0);
  __Pyx_INCREF(__pyx_v_minp);

  /* "pandas/algos.pyx":703
 * 
 * def _check_minp(win, minp, N, floor=1):
 *     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 = 703; __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 = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pandas/algos.pyx":705
 *     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 = 705; __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 = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pandas/algos.pyx":704
 * def _check_minp(win, minp, N, floor=1):
 *     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 = 704; __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 = 704; __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 = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/algos.pyx":706
 *         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 = 706; __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 = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pandas/algos.pyx":707
 *                         % (minp, win))
 *     elif minp > N:
 *         minp = N + 1             # <<<<<<<<<<<<<<
 *     elif minp < 0:
 *         raise ValueError('min_periods must be >= 0')
 */
    __pyx_t_3 = PyNumber_Add(__pyx_v_N, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __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":708
 *     elif minp > N:
 *         minp = N + 1
 *     elif minp < 0:             # <<<<<<<<<<<<<<
 *         raise ValueError('min_periods must be >= 0')
 *     return max(minp, floor)
 */
  __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 = 708; __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 = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pandas/algos.pyx":709
 *         minp = N + 1
 *     elif minp < 0:
 *         raise ValueError('min_periods must be >= 0')             # <<<<<<<<<<<<<<
 *     return max(minp, floor)
 * 
 */
    __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 = 709; __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 = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pandas/algos.pyx":710
 *     elif minp < 0:
 *         raise ValueError('min_periods must be >= 0')
 *     return max(minp, floor)             # <<<<<<<<<<<<<<
 * 
 * # original C implementation by N. Devillard.
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_floor);
  __pyx_t_3 = __pyx_v_floor;
  __Pyx_INCREF(__pyx_v_minp);
  __pyx_t_1 = __pyx_v_minp;
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = __pyx_t_3;
  } else {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = __pyx_t_1;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":702
 * # -
 * 
 * def _check_minp(win, minp, N, floor=1):             # <<<<<<<<<<<<<<
 *     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_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":743
 * 
 * 
 * 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":747
 * 
 *     # 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":748
 *     # 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":749
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

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

  /* "pandas/algos.pyx":743
 * 
 * 
 * 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":747
 * 
 *     # 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":748
 *     # 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":749
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

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

  /* "pandas/algos.pyx":743
 * 
 * 
 * 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":747
 * 
 *     # 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":748
 *     # 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":749
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

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

  /* "pandas/algos.pyx":743
 * 
 * 
 * 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":747
 * 
 *     # 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":748
 *     # 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":749
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

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

  /* "pandas/algos.pyx":743
 * 
 * 
 * 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":747
 * 
 *     # 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":748
 *     # 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":749
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

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

  /* "pandas/algos.pyx":743
 * 
 * 
 * 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":747
 * 
 *     # 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":748
 *     # 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":749
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

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

  /* "pandas/algos.pyx":743
 * 
 * 
 * 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":747
 * 
 *     # 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":748
 *     # 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":749
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

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

  /* "pandas/algos.pyx":743
 * 
 * 
 * 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":747
 * 
 *     # 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":748
 *     # 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":749
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

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

  /* "pandas/algos.pyx":743
 * 
 * 
 * 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":747
 * 
 *     # 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":748
 *     # 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":749
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

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

  /* "pandas/algos.pyx":743
 * 
 * 
 * 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":747
 * 
 *     # 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":748
 *     # 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":749
 *     t = a[0]
 *     a[0] = b[0]
 *     b[0] = t             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_b[0]) = __pyx_v_t;

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

  /* "pandas/algos.pyx":743
 * 
 * 
 * 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":755
 * @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 = {"kth_smallest", (PyCFunction)__pyx_pw_6pandas_5algos_15kth_smallest, METH_VARARGS|METH_KEYWORDS, 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 = 755; __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 = 755; __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 = 755; __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 = 755; __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 = 755; __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_ndarray = 0;
  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_int16_t_is_signed;
  int __pyx_v____pyx_uint8_t_is_signed;
  int __pyx_v____pyx_int64_t_is_signed;
  int __pyx_v____pyx_uint32_t_is_signed;
  int __pyx_v____pyx_int32_t_is_signed;
  int __pyx_v____pyx_uint64_t_is_signed;
  int __pyx_v____pyx_uint16_t_is_signed;
  PyObject *__pyx_v_arg = NULL;
  PyObject *__pyx_v_dtype = NULL;
  PyObject *__pyx_v_arg_base = 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;
  char __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *(*__pyx_t_19)(PyObject *);
  int __pyx_t_20;
  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(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __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 = 755; __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 = 755; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_numpy = __pyx_t_1;
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __pyx_v_ndarray = ((PyObject*)__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) || PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    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 = 755; __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_ndarray, ((PyObject*)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_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1) < 0);
  __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1) < 0);
  __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_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_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1) < 0);
  __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1) < 0);
  if (unlikely(__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((0 < __pyx_t_10) != 0);
  if (__pyx_t_3) {
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
    __Pyx_INCREF(__pyx_t_9);
    __pyx_v_arg = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L14;
  }
  if (unlikely(__pyx_v_kwargs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_n_s_a, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_a); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __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*/ {
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __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 = 755; __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 = 755; __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 = 755; __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 = 755; __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 = 755; __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_ndarray != ((PyObject*)Py_None));
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); 
        __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 = 755; __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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_v_arg_base = __pyx_t_8;
          __pyx_t_8 = 0;
          __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); 
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_dtype = __pyx_t_8;
            __pyx_t_8 = 0;
            goto __pyx_L20;
          }
          /*else*/ {
            __Pyx_INCREF(Py_None);
            __pyx_v_dtype = Py_None;
          }
          __pyx_L20:;
          goto __pyx_L19;
        }
        /*else*/ {
          __Pyx_INCREF(Py_None);
          __pyx_v_dtype = Py_None;
        }
        __pyx_L19:;
        __pyx_v_itemsize = -1;
        __pyx_t_3 = (__pyx_v_dtype != Py_None);
        __pyx_t_2 = (__pyx_t_3 != 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 = 755; __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 = 755; __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 = 755; __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 = 755; __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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_11 = __Pyx_PyInt_As_char(__pyx_t_8); if (unlikely((__pyx_t_11 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_v_kind = __pyx_t_11;
          __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
          switch (__pyx_v_kind) {
            case 'i':
            case 'u':
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L23_bool_binop_done;
            }
            __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 = 755; __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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L23_bool_binop_done;
            }
            __pyx_t_3 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L23_bool_binop_done:;
            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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L27_bool_binop_done;
            }
            __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 = 755; __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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L27_bool_binop_done;
            }
            __pyx_t_3 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L27_bool_binop_done:;
            if (__pyx_t_2) {
              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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L31_bool_binop_done;
            }
            __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 = 755; __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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L31_bool_binop_done;
            }
            __pyx_t_3 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L31_bool_binop_done:;
            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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L35_bool_binop_done;
            }
            __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 = 755; __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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L35_bool_binop_done;
            }
            __pyx_t_3 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L35_bool_binop_done:;
            if (__pyx_t_2) {
              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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L39_bool_binop_done;
            }
            __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 = 755; __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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L39_bool_binop_done;
            }
            __pyx_t_3 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L39_bool_binop_done:;
            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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L43_bool_binop_done;
            }
            __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 = 755; __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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L43_bool_binop_done;
            }
            __pyx_t_3 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L43_bool_binop_done:;
            if (__pyx_t_2) {
              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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L47_bool_binop_done;
            }
            __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 = 755; __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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L47_bool_binop_done;
            }
            __pyx_t_3 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L47_bool_binop_done:;
            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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L51_bool_binop_done;
            }
            __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 = 755; __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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L51_bool_binop_done;
            }
            __pyx_t_3 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L51_bool_binop_done:;
            if (__pyx_t_2) {
              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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            break;
            case 'f':
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L55_bool_binop_done;
            }
            __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 = 755; __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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L55_bool_binop_done:;
            if (__pyx_t_2) {
              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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L58_bool_binop_done;
            }
            __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 = 755; __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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L58_bool_binop_done:;
            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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            break;
            case 'c':
            break;
            case 'O':
            break;
            default: break;
          }
          goto __pyx_L21;
        }
        __pyx_L21:;
        goto __pyx_L18;
      }
      __pyx_L18:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L61_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L61_bool_binop_done:;
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_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_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L60;
      }
      __pyx_L60:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L65_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L65_bool_binop_done:;
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_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_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L64;
      }
      __pyx_L64:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L69_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L69_bool_binop_done:;
      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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L68;
      }
      __pyx_L68:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L73_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L73_bool_binop_done:;
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_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_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L72;
      }
      __pyx_L72:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L77_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L77_bool_binop_done:;
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_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_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L76;
      }
      __pyx_L76:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L81_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L81_bool_binop_done:;
      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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L80;
      }
      __pyx_L80:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L85_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L85_bool_binop_done:;
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_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_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L84;
      }
      __pyx_L84:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L89_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L89_bool_binop_done:;
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_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_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L88;
      }
      __pyx_L88:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L93_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L93_bool_binop_done:;
      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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L92;
      }
      __pyx_L92:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L97_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L97_bool_binop_done:;
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_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_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L96;
      }
      __pyx_L96:;
      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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L17_break;
    }
    __pyx_L17_break:;
  }
  __pyx_L15:;
  __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_v_candidates = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;
  __pyx_t_10 = 0;
  if (unlikely(__pyx_v_signatures == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_12), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_8);
  __pyx_t_8 = __pyx_t_9;
  __pyx_t_9 = 0;
  while (1) {
    __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_12, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
    if (unlikely(__pyx_t_13 == 0)) break;
    if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_v_match_found = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_dest_sig);
    PyTuple_SET_ITEM(__pyx_t_9, 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_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_14 = 0;
      __pyx_t_15 = NULL;
    } else {
      __pyx_t_14 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_15 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_15)) {
        if (likely(PyList_CheckExact(__pyx_t_9))) {
          if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_9)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_15(__pyx_t_9);
        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 = 755; __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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_16 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_17 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_16 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_17 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_16);
        __Pyx_INCREF(__pyx_t_17);
        #else
        __pyx_t_16 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_17 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_18 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_18);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_19 = Py_TYPE(__pyx_t_18)->tp_iternext;
        index = 0; __pyx_t_16 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_16)) goto __pyx_L104_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_16);
        index = 1; __pyx_t_17 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_17)) goto __pyx_L104_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_17);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_18), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_19 = NULL;
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
        goto __pyx_L105_unpacking_done;
        __pyx_L104_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
        __pyx_t_19 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L105_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_16);
      __pyx_t_16 = 0;
      __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_17);
      __pyx_t_17 = 0;
      __pyx_t_2 = (__pyx_v_dst_type != Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_3) {
          __pyx_v_match_found = 1;
          goto __pyx_L107;
        }
        /*else*/ {
          __pyx_v_match_found = 0;
          goto __pyx_L103_break;
        }
        __pyx_L107:;
        goto __pyx_L106;
      }
      __pyx_L106:;
    }
    __pyx_L103_break:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_3 = (__pyx_v_match_found != 0);
    if (__pyx_t_3) {
      __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_20 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L108;
    }
    __pyx_L108:;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_3 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
  __pyx_t_2 = ((!__pyx_t_3) != 0);
  if (__pyx_t_2) {
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_12 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((__pyx_t_12 > 1) != 0);
  if (__pyx_t_2) {
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_signatures == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_8);
    __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_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __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_ndarray);
  __Pyx_XDECREF(__pyx_v_numpy);
  __Pyx_XDECREF(__pyx_v_arg);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XDECREF(__pyx_v_arg_base);
  __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_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":757
 * 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 = 757; __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 = 757; __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 = 757; __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":760
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":761
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":763
 *     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":764
 * 
 *     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":765
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":766
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":768
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":769
 * 
 *         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":770
 *         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":771
 *             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":772
 *             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 = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":773
 *             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":775
 *                 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":777
 *             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":778
 * 
 *         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":779
 *         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":755
 * @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_535__pyx_fuse_0kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_0__pyx_mdef_6pandas_5algos_535__pyx_fuse_0kth_smallest = {"__pyx_fuse_0kth_smallest", (PyCFunction)__pyx_pw_6pandas_5algos_535__pyx_fuse_0kth_smallest, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_535__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 = 755; __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 = 755; __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 = 755; __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 = 755; __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 = 755; __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_534__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_534__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 = 755; __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 = 755; __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_537__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":757
 * 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 = 757; __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 = 757; __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 = 757; __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":760
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":761
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":763
 *     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":764
 * 
 *     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":765
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":766
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":768
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":769
 * 
 *         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":770
 *         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":771
 *             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":772
 *             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 = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":773
 *             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":775
 *                 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":777
 *             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":778
 * 
 *         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":779
 *         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":755
 * @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_537__pyx_fuse_1kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_1__pyx_mdef_6pandas_5algos_537__pyx_fuse_1kth_smallest = {"__pyx_fuse_1kth_smallest", (PyCFunction)__pyx_pw_6pandas_5algos_537__pyx_fuse_1kth_smallest, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_537__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 = 755; __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 = 755; __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 = 755; __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 = 755; __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 = 755; __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_536__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_536__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 = 755; __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 = 755; __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_539__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":757
 * 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 = 757; __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 = 757; __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 = 757; __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":760
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":761
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":763
 *     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":764
 * 
 *     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":765
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":766
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":768
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":769
 * 
 *         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":770
 *         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":771
 *             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":772
 *             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 = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":773
 *             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":775
 *                 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":777
 *             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":778
 * 
 *         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":779
 *         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":755
 * @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_539__pyx_fuse_2kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_2__pyx_mdef_6pandas_5algos_539__pyx_fuse_2kth_smallest = {"__pyx_fuse_2kth_smallest", (PyCFunction)__pyx_pw_6pandas_5algos_539__pyx_fuse_2kth_smallest, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_539__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 = 755; __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 = 755; __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 = 755; __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 = 755; __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 = 755; __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_538__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_538__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 = 755; __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 = 755; __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_541__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":757
 * 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 = 757; __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 = 757; __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 = 757; __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":760
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":761
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":763
 *     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":764
 * 
 *     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":765
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":766
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":768
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":769
 * 
 *         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":770
 *         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":771
 *             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":772
 *             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 = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":773
 *             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":775
 *                 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":777
 *             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":778
 * 
 *         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":779
 *         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":755
 * @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_541__pyx_fuse_3kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_3__pyx_mdef_6pandas_5algos_541__pyx_fuse_3kth_smallest = {"__pyx_fuse_3kth_smallest", (PyCFunction)__pyx_pw_6pandas_5algos_541__pyx_fuse_3kth_smallest, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_541__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 = 755; __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 = 755; __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 = 755; __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 = 755; __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 = 755; __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_540__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_540__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 = 755; __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 = 755; __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_543__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":757
 * 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 = 757; __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 = 757; __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 = 757; __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":760
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":761
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":763
 *     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":764
 * 
 *     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":765
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":766
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":768
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":769
 * 
 *         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":770
 *         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":771
 *             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":772
 *             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 = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":773
 *             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":775
 *                 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":777
 *             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":778
 * 
 *         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":779
 *         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":755
 * @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_543__pyx_fuse_4kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_4__pyx_mdef_6pandas_5algos_543__pyx_fuse_4kth_smallest = {"__pyx_fuse_4kth_smallest", (PyCFunction)__pyx_pw_6pandas_5algos_543__pyx_fuse_4kth_smallest, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_543__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 = 755; __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 = 755; __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 = 755; __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 = 755; __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 = 755; __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_542__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_542__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 = 755; __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 = 755; __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_545__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":757
 * 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 = 757; __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 = 757; __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 = 757; __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":760
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":761
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":763
 *     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":764
 * 
 *     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":765
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":766
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":768
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":769
 * 
 *         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":770
 *         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":771
 *             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":772
 *             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 = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":773
 *             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":775
 *                 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":777
 *             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":778
 * 
 *         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":779
 *         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":755
 * @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_545__pyx_fuse_5kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_5__pyx_mdef_6pandas_5algos_545__pyx_fuse_5kth_smallest = {"__pyx_fuse_5kth_smallest", (PyCFunction)__pyx_pw_6pandas_5algos_545__pyx_fuse_5kth_smallest, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_545__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 = 755; __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 = 755; __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 = 755; __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 = 755; __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 = 755; __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_544__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_544__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 = 755; __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 = 755; __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_547__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":757
 * 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 = 757; __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 = 757; __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 = 757; __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":760
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":761
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":763
 *     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":764
 * 
 *     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":765
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":766
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":768
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":769
 * 
 *         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":770
 *         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":771
 *             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":772
 *             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 = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":773
 *             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":775
 *                 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":777
 *             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":778
 * 
 *         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":779
 *         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":755
 * @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_547__pyx_fuse_6kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_6__pyx_mdef_6pandas_5algos_547__pyx_fuse_6kth_smallest = {"__pyx_fuse_6kth_smallest", (PyCFunction)__pyx_pw_6pandas_5algos_547__pyx_fuse_6kth_smallest, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_547__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 = 755; __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 = 755; __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 = 755; __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 = 755; __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 = 755; __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_546__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_546__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 = 755; __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 = 755; __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_549__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":757
 * 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 = 757; __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 = 757; __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 = 757; __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":760
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":761
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":763
 *     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":764
 * 
 *     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":765
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":766
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":768
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":769
 * 
 *         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":770
 *         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":771
 *             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":772
 *             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 = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":773
 *             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":775
 *                 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":777
 *             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":778
 * 
 *         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":779
 *         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":755
 * @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_549__pyx_fuse_7kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_7__pyx_mdef_6pandas_5algos_549__pyx_fuse_7kth_smallest = {"__pyx_fuse_7kth_smallest", (PyCFunction)__pyx_pw_6pandas_5algos_549__pyx_fuse_7kth_smallest, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_549__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 = 755; __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 = 755; __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 = 755; __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 = 755; __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 = 755; __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_548__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_548__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 = 755; __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 = 755; __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_551__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":757
 * 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 = 757; __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 = 757; __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 = 757; __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":760
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":761
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":763
 *     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":764
 * 
 *     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":765
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":766
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":768
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":769
 * 
 *         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":770
 *         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":771
 *             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":772
 *             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 = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":773
 *             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":775
 *                 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":777
 *             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":778
 * 
 *         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":779
 *         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":755
 * @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_551__pyx_fuse_8kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_8__pyx_mdef_6pandas_5algos_551__pyx_fuse_8kth_smallest = {"__pyx_fuse_8kth_smallest", (PyCFunction)__pyx_pw_6pandas_5algos_551__pyx_fuse_8kth_smallest, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_551__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 = 755; __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 = 755; __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 = 755; __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 = 755; __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 = 755; __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_550__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_550__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 = 755; __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 = 755; __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_553__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":757
 * 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 = 757; __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 = 757; __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 = 757; __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":760
 *         numeric x
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n - 1
 * 
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":761
 * 
 *     l = 0
 *     m = n - 1             # <<<<<<<<<<<<<<
 * 
 *     while l < m:
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":763
 *     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":764
 * 
 *     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":765
 *     while l < m:
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":766
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":768
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":769
 * 
 *         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":770
 *         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":771
 *             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":772
 *             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 = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":773
 *             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":775
 *                 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":777
 *             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":778
 * 
 *         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":779
 *         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":755
 * @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_553__pyx_fuse_9kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_fuse_9__pyx_mdef_6pandas_5algos_553__pyx_fuse_9kth_smallest = {"__pyx_fuse_9kth_smallest", (PyCFunction)__pyx_pw_6pandas_5algos_553__pyx_fuse_9kth_smallest, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_553__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 = 755; __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 = 755; __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 = 755; __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 = 755; __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 = 755; __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_552__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_552__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 = 755; __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 = 755; __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":782
 * 
 * 
 * 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":787
 *         double_t x, t
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n-1
 *     while (l<m):
 */
  __pyx_v_l = 0;

  /* "pandas/algos.pyx":788
 * 
 *     l = 0
 *     m = n-1             # <<<<<<<<<<<<<<
 *     while (l<m):
 *         x = a[k]
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "pandas/algos.pyx":789
 *     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":790
 *     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":791
 *     while (l<m):
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "pandas/algos.pyx":792
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "pandas/algos.pyx":794
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {

      /* "pandas/algos.pyx":795
 * 
 *         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":796
 *         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":797
 *             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":798
 *             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 = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/algos.pyx":799
 *             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":801
 *                 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":803
 *             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":804
 * 
 *         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":805
 *         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 = 805; __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":782
 * 
 * 
 * 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":808
 * 
 * 
 * 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 = {"median", (PyCFunction)__pyx_pw_6pandas_5algos_17median, METH_VARARGS|METH_KEYWORDS, __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 = 808; __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 = 808; __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 = 808; __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 = 808; __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 = 808; __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_ndarray = 0;
  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_int16_t_is_signed;
  int __pyx_v____pyx_uint8_t_is_signed;
  int __pyx_v____pyx_int64_t_is_signed;
  int __pyx_v____pyx_uint32_t_is_signed;
  int __pyx_v____pyx_int32_t_is_signed;
  int __pyx_v____pyx_uint64_t_is_signed;
  int __pyx_v____pyx_uint16_t_is_signed;
  PyObject *__pyx_v_arg = NULL;
  PyObject *__pyx_v_dtype = NULL;
  PyObject *__pyx_v_arg_base = 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;
  char __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *(*__pyx_t_19)(PyObject *);
  int __pyx_t_20;
  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 = 808; __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 = 808; __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 = 808; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_numpy = __pyx_t_1;
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __pyx_v_ndarray = ((PyObject*)__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) || PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    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 = 808; __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_ndarray, ((PyObject*)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_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1) < 0);
  __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1) < 0);
  __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_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_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1) < 0);
  __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1) < 0);
  if (unlikely(__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((0 < __pyx_t_10) != 0);
  if (__pyx_t_3) {
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = __Pyx_GetItemInt_Tuple(((PyObject*)__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 = 808; __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;
  }
  if (unlikely(__pyx_v_kwargs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __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*/ {
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __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 = 808; __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 = 808; __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 = 808; __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 = 808; __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 = 808; __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_ndarray != ((PyObject*)Py_None));
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); 
        __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 = 808; __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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_v_arg_base = __pyx_t_8;
          __pyx_t_8 = 0;
          __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); 
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_dtype = __pyx_t_8;
            __pyx_t_8 = 0;
            goto __pyx_L20;
          }
          /*else*/ {
            __Pyx_INCREF(Py_None);
            __pyx_v_dtype = Py_None;
          }
          __pyx_L20:;
          goto __pyx_L19;
        }
        /*else*/ {
          __Pyx_INCREF(Py_None);
          __pyx_v_dtype = Py_None;
        }
        __pyx_L19:;
        __pyx_v_itemsize = -1;
        __pyx_t_3 = (__pyx_v_dtype != Py_None);
        __pyx_t_2 = (__pyx_t_3 != 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 = 808; __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 = 808; __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 = 808; __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 = 808; __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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_11 = __Pyx_PyInt_As_char(__pyx_t_8); if (unlikely((__pyx_t_11 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_v_kind = __pyx_t_11;
          __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
          switch (__pyx_v_kind) {
            case 'i':
            case 'u':
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L23_bool_binop_done;
            }
            __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 = 808; __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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L23_bool_binop_done;
            }
            __pyx_t_3 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L23_bool_binop_done:;
            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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L27_bool_binop_done;
            }
            __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 = 808; __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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L27_bool_binop_done;
            }
            __pyx_t_3 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L27_bool_binop_done:;
            if (__pyx_t_2) {
              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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L31_bool_binop_done;
            }
            __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 = 808; __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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L31_bool_binop_done;
            }
            __pyx_t_3 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L31_bool_binop_done:;
            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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L35_bool_binop_done;
            }
            __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 = 808; __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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L35_bool_binop_done;
            }
            __pyx_t_3 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L35_bool_binop_done:;
            if (__pyx_t_2) {
              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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L39_bool_binop_done;
            }
            __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 = 808; __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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L39_bool_binop_done;
            }
            __pyx_t_3 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L39_bool_binop_done:;
            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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L43_bool_binop_done;
            }
            __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 = 808; __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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L43_bool_binop_done;
            }
            __pyx_t_3 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L43_bool_binop_done:;
            if (__pyx_t_2) {
              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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L47_bool_binop_done;
            }
            __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 = 808; __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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L47_bool_binop_done;
            }
            __pyx_t_3 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L47_bool_binop_done:;
            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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L51_bool_binop_done;
            }
            __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 = 808; __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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L51_bool_binop_done;
            }
            __pyx_t_3 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L51_bool_binop_done:;
            if (__pyx_t_2) {
              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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            break;
            case 'f':
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L55_bool_binop_done;
            }
            __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 = 808; __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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L55_bool_binop_done:;
            if (__pyx_t_2) {
              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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            __pyx_t_3 = (((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize) != 0);
            if (__pyx_t_3) {
            } else {
              __pyx_t_2 = __pyx_t_3;
              goto __pyx_L58_bool_binop_done;
            }
            __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 = 808; __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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
            __pyx_t_2 = __pyx_t_3;
            __pyx_L58_bool_binop_done:;
            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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L17_break;
            }
            break;
            case 'c':
            break;
            case 'O':
            break;
            default: break;
          }
          goto __pyx_L21;
        }
        __pyx_L21:;
        goto __pyx_L18;
      }
      __pyx_L18:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L61_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L61_bool_binop_done:;
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_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_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L60;
      }
      __pyx_L60:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L65_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L65_bool_binop_done:;
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_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_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L64;
      }
      __pyx_L64:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L69_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L69_bool_binop_done:;
      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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L68;
      }
      __pyx_L68:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L73_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L73_bool_binop_done:;
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_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_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L72;
      }
      __pyx_L72:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L77_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L77_bool_binop_done:;
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_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_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L76;
      }
      __pyx_L76:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L81_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L81_bool_binop_done:;
      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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L80;
      }
      __pyx_L80:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L85_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L85_bool_binop_done:;
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_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_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L84;
      }
      __pyx_L84:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L89_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L89_bool_binop_done:;
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_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_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L88;
      }
      __pyx_L88:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L93_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L93_bool_binop_done:;
      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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L92;
      }
      __pyx_L92:;
      __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L97_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L97_bool_binop_done:;
      if (__pyx_t_2) {
        __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_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_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17_break;
        }
        /*else*/ {
          PyErr_Clear();
        }
        goto __pyx_L96;
      }
      __pyx_L96:;
      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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L17_break;
    }
    __pyx_L17_break:;
  }
  __pyx_L15:;
  __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_v_candidates = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;
  __pyx_t_10 = 0;
  if (unlikely(__pyx_v_signatures == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_12), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_8);
  __pyx_t_8 = __pyx_t_9;
  __pyx_t_9 = 0;
  while (1) {
    __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_12, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
    if (unlikely(__pyx_t_13 == 0)) break;
    if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_v_match_found = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_dest_sig);
    PyTuple_SET_ITEM(__pyx_t_9, 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_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_14 = 0;
      __pyx_t_15 = NULL;
    } else {
      __pyx_t_14 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_15 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_15)) {
        if (likely(PyList_CheckExact(__pyx_t_9))) {
          if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_9)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_15(__pyx_t_9);
        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 = 808; __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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_16 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_17 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_16 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_17 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_16);
        __Pyx_INCREF(__pyx_t_17);
        #else
        __pyx_t_16 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_17 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_18 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_18);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_19 = Py_TYPE(__pyx_t_18)->tp_iternext;
        index = 0; __pyx_t_16 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_16)) goto __pyx_L104_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_16);
        index = 1; __pyx_t_17 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_17)) goto __pyx_L104_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_17);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_18), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_19 = NULL;
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
        goto __pyx_L105_unpacking_done;
        __pyx_L104_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
        __pyx_t_19 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L105_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_16);
      __pyx_t_16 = 0;
      __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_17);
      __pyx_t_17 = 0;
      __pyx_t_2 = (__pyx_v_dst_type != Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_3) {
          __pyx_v_match_found = 1;
          goto __pyx_L107;
        }
        /*else*/ {
          __pyx_v_match_found = 0;
          goto __pyx_L103_break;
        }
        __pyx_L107:;
        goto __pyx_L106;
      }
      __pyx_L106:;
    }
    __pyx_L103_break:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_3 = (__pyx_v_match_found != 0);
    if (__pyx_t_3) {
      __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_20 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L108;
    }
    __pyx_L108:;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_3 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
  __pyx_t_2 = ((!__pyx_t_3) != 0);
  if (__pyx_t_2) {
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_12 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((__pyx_t_12 > 1) != 0);
  if (__pyx_t_2) {
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_signatures == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_8); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __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_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __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_ndarray);
  __Pyx_XDECREF(__pyx_v_numpy);
  __Pyx_XDECREF(__pyx_v_arg);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XDECREF(__pyx_v_arg_base);
  __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_557__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":812
 *     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 = 812; __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 = 812; __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 = 812; __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":814
 *     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":815
 * 
 *     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 = 815; __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 = 815; __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 = 815; __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":817
 *         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 = 817; __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":819
 *     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":820
 * 
 *     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":823
 *     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":808
 * 
 * 
 * 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_557__pyx_fuse_0median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_0__pyx_mdef_6pandas_5algos_557__pyx_fuse_0median = {"__pyx_fuse_0median", (PyCFunction)__pyx_pw_6pandas_5algos_557__pyx_fuse_0median, METH_O, __pyx_doc_6pandas_5algos_16median};
static PyObject *__pyx_pw_6pandas_5algos_557__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 = 808; __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_556__pyx_fuse_0median(__pyx_self, __pyx_v_arr);

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

static PyObject *__pyx_pf_6pandas_5algos_556__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 = 808; __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 = 808; __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_559__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":812
 *     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 = 812; __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 = 812; __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 = 812; __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":814
 *     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":815
 * 
 *     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 = 815; __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 = 815; __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 = 815; __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":817
 *         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 = 817; __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":819
 *     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":820
 * 
 *     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":823
 *     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":808
 * 
 * 
 * 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_559__pyx_fuse_1median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_1__pyx_mdef_6pandas_5algos_559__pyx_fuse_1median = {"__pyx_fuse_1median", (PyCFunction)__pyx_pw_6pandas_5algos_559__pyx_fuse_1median, METH_O, __pyx_doc_6pandas_5algos_16median};
static PyObject *__pyx_pw_6pandas_5algos_559__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 = 808; __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_558__pyx_fuse_1median(__pyx_self, __pyx_v_arr);

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

static PyObject *__pyx_pf_6pandas_5algos_558__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 = 808; __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 = 808; __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_561__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":812
 *     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 = 812; __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 = 812; __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 = 812; __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":814
 *     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":815
 * 
 *     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 = 815; __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 = 815; __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 = 815; __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":817
 *         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 = 817; __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":819
 *     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":820
 * 
 *     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":823
 *     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":808
 * 
 * 
 * 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_561__pyx_fuse_2median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_2__pyx_mdef_6pandas_5algos_561__pyx_fuse_2median = {"__pyx_fuse_2median", (PyCFunction)__pyx_pw_6pandas_5algos_561__pyx_fuse_2median, METH_O, __pyx_doc_6pandas_5algos_16median};
static PyObject *__pyx_pw_6pandas_5algos_561__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 = 808; __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_560__pyx_fuse_2median(__pyx_self, __pyx_v_arr);

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

static PyObject *__pyx_pf_6pandas_5algos_560__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 = 808; __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 = 808; __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_563__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":812
 *     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 = 812; __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 = 812; __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 = 812; __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":814
 *     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":815
 * 
 *     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 = 815; __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 = 815; __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 = 815; __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":817
 *         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 = 817; __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":819
 *     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":820
 * 
 *     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":823
 *     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":808
 * 
 * 
 * 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_563__pyx_fuse_3median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_3__pyx_mdef_6pandas_5algos_563__pyx_fuse_3median = {"__pyx_fuse_3median", (PyCFunction)__pyx_pw_6pandas_5algos_563__pyx_fuse_3median, METH_O, __pyx_doc_6pandas_5algos_16median};
static PyObject *__pyx_pw_6pandas_5algos_563__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 = 808; __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_562__pyx_fuse_3median(__pyx_self, __pyx_v_arr);

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

static PyObject *__pyx_pf_6pandas_5algos_562__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 = 808; __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 = 808; __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_565__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":812
 *     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 = 812; __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 = 812; __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 = 812; __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":814
 *     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":815
 * 
 *     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 = 815; __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 = 815; __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 = 815; __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":817
 *         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 = 817; __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":819
 *     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":820
 * 
 *     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":823
 *     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":808
 * 
 * 
 * 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_565__pyx_fuse_4median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_4__pyx_mdef_6pandas_5algos_565__pyx_fuse_4median = {"__pyx_fuse_4median", (PyCFunction)__pyx_pw_6pandas_5algos_565__pyx_fuse_4median, METH_O, __pyx_doc_6pandas_5algos_16median};
static PyObject *__pyx_pw_6pandas_5algos_565__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 = 808; __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_564__pyx_fuse_4median(__pyx_self, __pyx_v_arr);

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

static PyObject *__pyx_pf_6pandas_5algos_564__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 = 808; __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 = 808; __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_567__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":812
 *     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 = 812; __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 = 812; __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 = 812; __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":814
 *     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":815
 * 
 *     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 = 815; __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 = 815; __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 = 815; __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":817
 *         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 = 817; __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":819
 *     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":820
 * 
 *     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":823
 *     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":808
 * 
 * 
 * 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_567__pyx_fuse_5median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_5__pyx_mdef_6pandas_5algos_567__pyx_fuse_5median = {"__pyx_fuse_5median", (PyCFunction)__pyx_pw_6pandas_5algos_567__pyx_fuse_5median, METH_O, __pyx_doc_6pandas_5algos_16median};
static PyObject *__pyx_pw_6pandas_5algos_567__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 = 808; __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_566__pyx_fuse_5median(__pyx_self, __pyx_v_arr);

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

static PyObject *__pyx_pf_6pandas_5algos_566__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 = 808; __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 = 808; __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_569__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":812
 *     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 = 812; __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 = 812; __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 = 812; __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":814
 *     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":815
 * 
 *     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 = 815; __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 = 815; __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 = 815; __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":817
 *         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 = 817; __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":819
 *     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":820
 * 
 *     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":823
 *     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":808
 * 
 * 
 * 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_569__pyx_fuse_6median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_6__pyx_mdef_6pandas_5algos_569__pyx_fuse_6median = {"__pyx_fuse_6median", (PyCFunction)__pyx_pw_6pandas_5algos_569__pyx_fuse_6median, METH_O, __pyx_doc_6pandas_5algos_16median};
static PyObject *__pyx_pw_6pandas_5algos_569__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 = 808; __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_568__pyx_fuse_6median(__pyx_self, __pyx_v_arr);

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

static PyObject *__pyx_pf_6pandas_5algos_568__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 = 808; __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 = 808; __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_571__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":812
 *     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 = 812; __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 = 812; __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 = 812; __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":814
 *     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":815
 * 
 *     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 = 815; __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 = 815; __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 = 815; __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":817
 *         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 = 817; __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":819
 *     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":820
 * 
 *     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":823
 *     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":808
 * 
 * 
 * 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_571__pyx_fuse_7median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_7__pyx_mdef_6pandas_5algos_571__pyx_fuse_7median = {"__pyx_fuse_7median", (PyCFunction)__pyx_pw_6pandas_5algos_571__pyx_fuse_7median, METH_O, __pyx_doc_6pandas_5algos_16median};
static PyObject *__pyx_pw_6pandas_5algos_571__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 = 808; __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_570__pyx_fuse_7median(__pyx_self, __pyx_v_arr);

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

static PyObject *__pyx_pf_6pandas_5algos_570__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 = 808; __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 = 808; __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_573__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":812
 *     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 = 812; __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 = 812; __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 = 812; __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":814
 *     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":815
 * 
 *     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 = 815; __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 = 815; __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 = 815; __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":817
 *         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 = 817; __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":819
 *     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":820
 * 
 *     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":823
 *     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":808
 * 
 * 
 * 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_573__pyx_fuse_8median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_8__pyx_mdef_6pandas_5algos_573__pyx_fuse_8median = {"__pyx_fuse_8median", (PyCFunction)__pyx_pw_6pandas_5algos_573__pyx_fuse_8median, METH_O, __pyx_doc_6pandas_5algos_16median};
static PyObject *__pyx_pw_6pandas_5algos_573__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 = 808; __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_572__pyx_fuse_8median(__pyx_self, __pyx_v_arr);

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

static PyObject *__pyx_pf_6pandas_5algos_572__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 = 808; __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 = 808; __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_575__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":812
 *     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 = 812; __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 = 812; __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 = 812; __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":814
 *     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":815
 * 
 *     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 = 815; __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 = 815; __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 = 815; __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":817
 *         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 = 817; __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":819
 *     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":820
 * 
 *     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":823
 *     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":808
 * 
 * 
 * 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_575__pyx_fuse_9median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/
static PyMethodDef __pyx_fuse_9__pyx_mdef_6pandas_5algos_575__pyx_fuse_9median = {"__pyx_fuse_9median", (PyCFunction)__pyx_pw_6pandas_5algos_575__pyx_fuse_9median, METH_O, __pyx_doc_6pandas_5algos_16median};
static PyObject *__pyx_pw_6pandas_5algos_575__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 = 808; __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_574__pyx_fuse_9median(__pyx_self, __pyx_v_arr);

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

static PyObject *__pyx_pf_6pandas_5algos_574__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 = 808; __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 = 808; __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":828
 * # -------------- 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 = {"max_subseq", (PyCFunction)__pyx_pw_6pandas_5algos_19max_subseq, METH_O, 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 = 828; __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 = 828; __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":830
 * 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":833
 *         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 = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/algos.pyx":835
 *     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 = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((__pyx_t_1 == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/algos.pyx":836
 * 
 *     if len(arr) == 0:
 *         return (-1,-1,None)             # <<<<<<<<<<<<<<
 * 
 *     m = arr[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__41);
    __pyx_r = __pyx_tuple__41;
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":838
 *         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 = 838; __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":839
 * 
 *     m = arr[0]
 *     S = m             # <<<<<<<<<<<<<<
 *     T = 0
 * 
 */
  __pyx_v_S = __pyx_v_m;

  /* "pandas/algos.pyx":840
 *     m = arr[0]
 *     S = m
 *     T = 0             # <<<<<<<<<<<<<<
 * 
 *     for i in range(1, n):
 */
  __pyx_v_T = 0;

  /* "pandas/algos.pyx":842
 *     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":844
 *     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":845
 *         # 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 = 845; __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":847
 *             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 = 847; __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":848
 *         else:
 *             S = arr[i]
 *             T = i             # <<<<<<<<<<<<<<
 *         if S > m:
 *             s = T
 */
      __pyx_v_T = __pyx_v_i;
    }
    __pyx_L6:;

    /* "pandas/algos.pyx":849
 *             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":850
 *             T = i
 *         if S > m:
 *             s = T             # <<<<<<<<<<<<<<
 *             e = i
 *             m = S
 */
      __pyx_v_s = __pyx_v_T;

      /* "pandas/algos.pyx":851
 *         if S > m:
 *             s = T
 *             e = i             # <<<<<<<<<<<<<<
 *             m = S
 * 
 */
      __pyx_v_e = __pyx_v_i;

      /* "pandas/algos.pyx":852
 *             s = T
 *             e = i
 *             m = S             # <<<<<<<<<<<<<<
 * 
 *     return (s, e, m)
 */
      __pyx_v_m = __pyx_v_S;
      goto __pyx_L7;
    }
    __pyx_L7:;
  }

  /* "pandas/algos.pyx":854
 *             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 = 854; __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 = 854; __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 = 854; __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 = 854; __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":828
 * # -------------- 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":856
 *     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 = {"min_subseq", (PyCFunction)__pyx_pw_6pandas_5algos_21min_subseq, METH_O, 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 = 856; __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 = 856; __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":861
 *         double m
 * 
 *     (s, e, m) = max_subseq(-arr)             # <<<<<<<<<<<<<<
 * 
 *     return (s, e, -m)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_max_subseq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Negative(((PyObject *)__pyx_v_arr)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __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); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_5);
    __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 = 861; __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 = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __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 = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 2; __pyx_t_3 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_4), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = 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_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_s = __pyx_t_7;
  __pyx_v_e = __pyx_t_8;
  __pyx_v_m = __pyx_t_9;

  /* "pandas/algos.pyx":863
 *     (s, e, m) = max_subseq(-arr)
 * 
 *     return (s, e, -m)             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_e); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyFloat_FromDouble((-__pyx_v_m)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __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);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":856
 *     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":868
 * # 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 = {"roll_sum", (PyCFunction)__pyx_pw_6pandas_5algos_23roll_sum, METH_VARARGS|METH_KEYWORDS, 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 = 868; __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 = 868; __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 = 868; __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 = 868; __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 = 868; __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 = 868; __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 = 868; __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;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  long __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_t_18;
  int __pyx_t_19;
  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 = 868; __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":869
 * 
 * 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":870
 * 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":871
 *     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 = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":873
 *     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 = 873; __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 = 873; __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 = 873; __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 = 873; __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 = 873; __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 = 873; __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 = 873; __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 = 873; __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 = 873; __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":875
 *     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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_1 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_1 = 1;
    }
  }
  __pyx_t_9 = PyTuple_New(3+__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  if (__pyx_t_8) {
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
  }
  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_1, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_7 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_minp = __pyx_t_10;

  /* "pandas/algos.pyx":877
 *     minp = _check_minp(win, minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_11 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "pandas/algos.pyx":878
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_12 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_12 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_input.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 = 878; __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_10, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":881
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             sum_x += val
 */
    __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_13) {

      /* "pandas/algos.pyx":882
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             sum_x += val
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":883
 *         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":885
 *             sum_x += val
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_14 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_14 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_output.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 = 885; __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_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":887
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_14 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_14; __pyx_v_i++) {

    /* "pandas/algos.pyx":888
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_16 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_input.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 = 888; __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_15, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":890
 *         val = input[i]
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             sum_x += val
 */
    __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_13) {

      /* "pandas/algos.pyx":891
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             sum_x += val
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":892
 *         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":894
 *             sum_x += val
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 *             if prev == prev:
 */
    __pyx_t_13 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0);
    if (__pyx_t_13) {

      /* "pandas/algos.pyx":895
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 *             if prev == prev:
 *                 sum_x -= prev
 */
      __pyx_t_16 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_17 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_input.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_input.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 = 895; __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_16, __pyx_pybuffernd_input.diminfo[0].strides));

      /* "pandas/algos.pyx":896
 *         if i > win - 1:
 *             prev = input[i - win]
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 sum_x -= prev
 *                 nobs -= 1
 */
      __pyx_t_13 = ((__pyx_v_prev == __pyx_v_prev) != 0);
      if (__pyx_t_13) {

        /* "pandas/algos.pyx":897
 *             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":898
 *             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":900
 *                 nobs -= 1
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             output[i] = sum_x
 *         else:
 */
    __pyx_t_13 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
    if (__pyx_t_13) {

      /* "pandas/algos.pyx":901
 * 
 *         if nobs >= minp:
 *             output[i] = sum_x             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_18 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_18 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_18 = 0;
      if (unlikely(__pyx_t_18 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_18);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __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_sum_x;
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/algos.pyx":903
 *             output[i] = sum_x
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __pyx_t_18 = __pyx_v_i;
      __pyx_t_19 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_19 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_19 = 0;
      if (unlikely(__pyx_t_19 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_19);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __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_L11:;
  }

  /* "pandas/algos.pyx":905
 *             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":868
 * # 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);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":910
 * # 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 = {"roll_mean", (PyCFunction)__pyx_pw_6pandas_5algos_25roll_mean, METH_VARARGS|METH_KEYWORDS, 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 = 910; __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 = 910; __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 = 910; __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 = 911; __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 = 911; __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 = 910; __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 = 910; __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;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  long __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  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;
  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 = 910; __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":913
 *                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":914
 *     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":915
 *         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 = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":917
 *         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 = 917; __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 = 917; __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 = 917; __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 = 917; __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 = 917; __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 = 917; __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 = 917; __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 = 917; __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 = 917; __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":918
 * 
 *     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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_1 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_1 = 1;
    }
  }
  __pyx_t_9 = PyTuple_New(3+__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  if (__pyx_t_8) {
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
  }
  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_1, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_7 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_minp = __pyx_t_10;

  /* "pandas/algos.pyx":920
 *     minp = _check_minp(win, minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_11 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "pandas/algos.pyx":921
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_1 >= __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 = 921; __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":924
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             sum_x += val
 */
    __pyx_t_12 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":925
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             sum_x += val
 *             if signbit(val):
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":926
 *         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":927
 *             nobs += 1
 *             sum_x += val
 *             if signbit(val):             # <<<<<<<<<<<<<<
 *                 neg_ct += 1
 * 
 */
      __pyx_t_12 = (signbit(__pyx_v_val) != 0);
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":928
 *             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":930
 *                 neg_ct += 1
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_13 = __pyx_v_i;
    __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 = 930; __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_v_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":932
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_14 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_14; __pyx_v_i++) {

    /* "pandas/algos.pyx":933
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_15 >= __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 = 933; __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_15, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":935
 *         val = input[i]
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             sum_x += val
 */
    __pyx_t_12 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":936
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             sum_x += val
 *             if signbit(val):
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":937
 *         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":938
 *             nobs += 1
 *             sum_x += val
 *             if signbit(val):             # <<<<<<<<<<<<<<
 *                 neg_ct += 1
 * 
 */
      __pyx_t_12 = (signbit(__pyx_v_val) != 0);
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":939
 *             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":941
 *                 neg_ct += 1
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 *             if prev == prev:
 */
    __pyx_t_12 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":942
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 *             if prev == prev:
 *                 sum_x -= prev
 */
      __pyx_t_16 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_10 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_input.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_16 >= __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 = 942; __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_16, __pyx_pybuffernd_input.diminfo[0].strides));

      /* "pandas/algos.pyx":943
 *         if i > win - 1:
 *             prev = input[i - win]
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 sum_x -= prev
 *                 nobs -= 1
 */
      __pyx_t_12 = ((__pyx_v_prev == __pyx_v_prev) != 0);
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":944
 *             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":945
 *             if prev == prev:
 *                 sum_x -= prev
 *                 nobs -= 1             # <<<<<<<<<<<<<<
 *                 if signbit(prev):
 *                     neg_ct -= 1
 */
        __pyx_v_nobs = (__pyx_v_nobs - 1);

        /* "pandas/algos.pyx":946
 *                 sum_x -= prev
 *                 nobs -= 1
 *                 if signbit(prev):             # <<<<<<<<<<<<<<
 *                     neg_ct -= 1
 * 
 */
        __pyx_t_12 = (signbit(__pyx_v_prev) != 0);
        if (__pyx_t_12) {

          /* "pandas/algos.pyx":947
 *                 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":949
 *                     neg_ct -= 1
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             result = sum_x / nobs
 *             if neg_ct == 0 and result < 0:
 */
    __pyx_t_12 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":950
 * 
 *         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 = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_result = (__pyx_v_sum_x / __pyx_v_nobs);

      /* "pandas/algos.pyx":951
 *         if nobs >= minp:
 *             result = sum_x / nobs
 *             if neg_ct == 0 and result < 0:             # <<<<<<<<<<<<<<
 *                 # all positive
 *                 output[i] = 0
 */
      __pyx_t_17 = ((__pyx_v_neg_ct == 0) != 0);
      if (__pyx_t_17) {
      } else {
        __pyx_t_12 = __pyx_t_17;
        goto __pyx_L16_bool_binop_done;
      }
      __pyx_t_17 = ((__pyx_v_result < 0.0) != 0);
      __pyx_t_12 = __pyx_t_17;
      __pyx_L16_bool_binop_done:;
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":953
 *             if neg_ct == 0 and result < 0:
 *                 # all positive
 *                 output[i] = 0             # <<<<<<<<<<<<<<
 *             elif neg_ct == nobs and result > 0:
 *                 # all negative
 */
        __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 = 953; __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;
      }

      /* "pandas/algos.pyx":954
 *                 # all positive
 *                 output[i] = 0
 *             elif neg_ct == nobs and result > 0:             # <<<<<<<<<<<<<<
 *                 # all negative
 *                 output[i] = 0
 */
      __pyx_t_17 = ((__pyx_v_neg_ct == __pyx_v_nobs) != 0);
      if (__pyx_t_17) {
      } else {
        __pyx_t_12 = __pyx_t_17;
        goto __pyx_L18_bool_binop_done;
      }
      __pyx_t_17 = ((__pyx_v_result > 0.0) != 0);
      __pyx_t_12 = __pyx_t_17;
      __pyx_L18_bool_binop_done:;
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":956
 *             elif neg_ct == nobs and result > 0:
 *                 # all negative
 *                 output[i] = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 output[i] = result
 */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_10 = -1;
        if (__pyx_t_19 < 0) {
          __pyx_t_19 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_19 >= __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 = 956; __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) = 0.0;
        goto __pyx_L15;
      }
      /*else*/ {

        /* "pandas/algos.pyx":958
 *                 output[i] = 0
 *             else:
 *                 output[i] = result             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
        __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 = 958; __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_result;
      }
      __pyx_L15:;
      goto __pyx_L14;
    }
    /*else*/ {

      /* "pandas/algos.pyx":960
 *                 output[i] = result
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __pyx_t_21 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_21 >= __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 = 960; __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_L14:;
  }

  /* "pandas/algos.pyx":962
 *             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":910
 * # 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);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":967
 * # Exponentially weighted moving average
 * 
 * def ewma(ndarray[double_t] input, double_t com, int adjust, int ignore_na, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     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    adjust: int\n    ignore_na: int\n    minp: int\n\n    Returns\n    -------\n    y : ndarray\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_27ewma = {"ewma", (PyCFunction)__pyx_pw_6pandas_5algos_27ewma, METH_VARARGS|METH_KEYWORDS, __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_v_ignore_na;
  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("ewma (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_com,&__pyx_n_s_adjust,&__pyx_n_s_ignore_na,&__pyx_n_s_minp,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_com)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ewma", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __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, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ignore_na)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ewma", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ewma", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __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 = 967; __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_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 = 967; __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 = 967; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_ignore_na = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_ignore_na == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ewma", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __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 = 967; __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, __pyx_v_ignore_na, __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_26ewma(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_double_t __pyx_v_com, int __pyx_v_adjust, int __pyx_v_ignore_na, int __pyx_v_minp) {
  Py_ssize_t __pyx_v_N;
  PyArrayObject *__pyx_v_output = 0;
  double __pyx_v_alpha;
  double __pyx_v_old_wt_factor;
  double __pyx_v_new_wt;
  double __pyx_v_weighted_avg;
  double __pyx_v_old_wt;
  double __pyx_v_cur;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_nobs;
  PyObject *__pyx_v_is_observation = 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;
  int __pyx_t_7;
  long __pyx_t_8;
  int __pyx_t_9;
  long __pyx_t_10;
  __pyx_t_5numpy_double_t __pyx_t_11;
  double __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  double __pyx_t_16;
  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 = 967; __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":984
 *     '''
 * 
 *     cdef Py_ssize_t N = len(input)             # <<<<<<<<<<<<<<
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 *     if N == 0:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":985
 * 
 *     cdef Py_ssize_t N = len(input)
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)             # <<<<<<<<<<<<<<
 *     if N == 0:
 *         return output
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __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 = 985; __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 = 985; __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 = 985; __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 = 985; __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 = 985; __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 = 985; __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 = 985; __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":986
 *     cdef Py_ssize_t N = len(input)
 *     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":987
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 *     if N == 0:
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     minp = max(minp, 1)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_output));
    __pyx_r = ((PyObject *)__pyx_v_output);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":989
 *         return output
 * 
 *     minp = max(minp, 1)             # <<<<<<<<<<<<<<
 * 
 *     cdef double alpha, old_wt_factor, new_wt, weighted_avg, old_wt, cur
 */
  __pyx_t_8 = 1;
  __pyx_t_9 = __pyx_v_minp;
  if (((__pyx_t_8 > __pyx_t_9) != 0)) {
    __pyx_t_10 = __pyx_t_8;
  } else {
    __pyx_t_10 = __pyx_t_9;
  }
  __pyx_v_minp = __pyx_t_10;

  /* "pandas/algos.pyx":994
 *     cdef Py_ssize_t i, nobs
 * 
 *     alpha = 1. / (1. + com)             # <<<<<<<<<<<<<<
 *     old_wt_factor = 1. - alpha
 *     new_wt = 1. if adjust else alpha
 */
  __pyx_t_11 = (1. + __pyx_v_com);
  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 = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_alpha = (1. / __pyx_t_11);

  /* "pandas/algos.pyx":995
 * 
 *     alpha = 1. / (1. + com)
 *     old_wt_factor = 1. - alpha             # <<<<<<<<<<<<<<
 *     new_wt = 1. if adjust else alpha
 * 
 */
  __pyx_v_old_wt_factor = (1. - __pyx_v_alpha);

  /* "pandas/algos.pyx":996
 *     alpha = 1. / (1. + com)
 *     old_wt_factor = 1. - alpha
 *     new_wt = 1. if adjust else alpha             # <<<<<<<<<<<<<<
 * 
 *     weighted_avg = input[0]
 */
  if ((__pyx_v_adjust != 0)) {
    __pyx_t_12 = 1.;
  } else {
    __pyx_t_12 = __pyx_v_alpha;
  }
  __pyx_v_new_wt = __pyx_t_12;

  /* "pandas/algos.pyx":998
 *     new_wt = 1. if adjust else alpha
 * 
 *     weighted_avg = input[0]             # <<<<<<<<<<<<<<
 *     is_observation = (weighted_avg == weighted_avg)
 *     nobs = int(is_observation)
 */
  __pyx_t_10 = 0;
  __pyx_t_9 = -1;
  if (__pyx_t_10 < 0) {
    __pyx_t_10 += __pyx_pybuffernd_input.diminfo[0].shape;
    if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_10 >= __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 = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_weighted_avg = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_input.diminfo[0].strides));

  /* "pandas/algos.pyx":999
 * 
 *     weighted_avg = input[0]
 *     is_observation = (weighted_avg == weighted_avg)             # <<<<<<<<<<<<<<
 *     nobs = int(is_observation)
 *     output[0] = weighted_avg if (nobs >= minp) else NaN
 */
  __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_weighted_avg == __pyx_v_weighted_avg)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_is_observation = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":1000
 *     weighted_avg = input[0]
 *     is_observation = (weighted_avg == weighted_avg)
 *     nobs = int(is_observation)             # <<<<<<<<<<<<<<
 *     output[0] = weighted_avg if (nobs >= minp) else NaN
 *     old_wt = 1.
 */
  __pyx_t_5 = PyNumber_Int(__pyx_v_is_observation); 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_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_nobs = __pyx_t_1;

  /* "pandas/algos.pyx":1001
 *     is_observation = (weighted_avg == weighted_avg)
 *     nobs = int(is_observation)
 *     output[0] = weighted_avg if (nobs >= minp) else NaN             # <<<<<<<<<<<<<<
 *     old_wt = 1.
 * 
 */
  if (((__pyx_v_nobs >= __pyx_v_minp) != 0)) {
    __pyx_t_12 = __pyx_v_weighted_avg;
  } else {
    __pyx_t_12 = __pyx_v_6pandas_5algos_NaN;
  }
  __pyx_t_8 = 0;
  __pyx_t_9 = -1;
  if (__pyx_t_8 < 0) {
    __pyx_t_8 += __pyx_pybuffernd_output.diminfo[0].shape;
    if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_8 >= __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 = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_t_12;

  /* "pandas/algos.pyx":1002
 *     nobs = int(is_observation)
 *     output[0] = weighted_avg if (nobs >= minp) else NaN
 *     old_wt = 1.             # <<<<<<<<<<<<<<
 * 
 *     for i from 1 <= i < N:
 */
  __pyx_v_old_wt = 1.;

  /* "pandas/algos.pyx":1004
 *     old_wt = 1.
 * 
 *     for i from 1 <= i < N:             # <<<<<<<<<<<<<<
 *         cur = input[i]
 *         is_observation = (cur == cur)
 */
  __pyx_t_1 = __pyx_v_N;
  for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/algos.pyx":1005
 * 
 *     for i from 1 <= i < N:
 *         cur = input[i]             # <<<<<<<<<<<<<<
 *         is_observation = (cur == cur)
 *         nobs += int(is_observation)
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_13 >= __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 = 1005; __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_13, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1006
 *     for i from 1 <= i < N:
 *         cur = input[i]
 *         is_observation = (cur == cur)             # <<<<<<<<<<<<<<
 *         nobs += int(is_observation)
 *         if weighted_avg == weighted_avg:
 */
    __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_cur == __pyx_v_cur)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_is_observation, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "pandas/algos.pyx":1007
 *         cur = input[i]
 *         is_observation = (cur == cur)
 *         nobs += int(is_observation)             # <<<<<<<<<<<<<<
 *         if weighted_avg == weighted_avg:
 *             if is_observation or (not ignore_na):
 */
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_nobs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyNumber_Int(__pyx_v_is_observation); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_nobs = __pyx_t_14;

    /* "pandas/algos.pyx":1008
 *         is_observation = (cur == cur)
 *         nobs += int(is_observation)
 *         if weighted_avg == weighted_avg:             # <<<<<<<<<<<<<<
 *             if is_observation or (not ignore_na):
 *                 old_wt *= old_wt_factor
 */
    __pyx_t_7 = ((__pyx_v_weighted_avg == __pyx_v_weighted_avg) != 0);
    if (__pyx_t_7) {

      /* "pandas/algos.pyx":1009
 *         nobs += int(is_observation)
 *         if weighted_avg == weighted_avg:
 *             if is_observation or (not ignore_na):             # <<<<<<<<<<<<<<
 *                 old_wt *= old_wt_factor
 *                 if is_observation:
 */
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_is_observation); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (!__pyx_t_15) {
      } else {
        __pyx_t_7 = __pyx_t_15;
        goto __pyx_L8_bool_binop_done;
      }
      __pyx_t_15 = ((!(__pyx_v_ignore_na != 0)) != 0);
      __pyx_t_7 = __pyx_t_15;
      __pyx_L8_bool_binop_done:;
      if (__pyx_t_7) {

        /* "pandas/algos.pyx":1010
 *         if weighted_avg == weighted_avg:
 *             if is_observation or (not ignore_na):
 *                 old_wt *= old_wt_factor             # <<<<<<<<<<<<<<
 *                 if is_observation:
 *                     if weighted_avg != cur:  # avoid numerical errors on constant series
 */
        __pyx_v_old_wt = (__pyx_v_old_wt * __pyx_v_old_wt_factor);

        /* "pandas/algos.pyx":1011
 *             if is_observation or (not ignore_na):
 *                 old_wt *= old_wt_factor
 *                 if is_observation:             # <<<<<<<<<<<<<<
 *                     if weighted_avg != cur:  # avoid numerical errors on constant series
 *                         weighted_avg = ((old_wt * weighted_avg) + (new_wt * cur)) / (old_wt + new_wt)
 */
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_is_observation); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__pyx_t_7) {

          /* "pandas/algos.pyx":1012
 *                 old_wt *= old_wt_factor
 *                 if is_observation:
 *                     if weighted_avg != cur:  # avoid numerical errors on constant series             # <<<<<<<<<<<<<<
 *                         weighted_avg = ((old_wt * weighted_avg) + (new_wt * cur)) / (old_wt + new_wt)
 *                     if adjust:
 */
          __pyx_t_7 = ((__pyx_v_weighted_avg != __pyx_v_cur) != 0);
          if (__pyx_t_7) {

            /* "pandas/algos.pyx":1013
 *                 if is_observation:
 *                     if weighted_avg != cur:  # avoid numerical errors on constant series
 *                         weighted_avg = ((old_wt * weighted_avg) + (new_wt * cur)) / (old_wt + new_wt)             # <<<<<<<<<<<<<<
 *                     if adjust:
 *                         old_wt += new_wt
 */
            __pyx_t_12 = ((__pyx_v_old_wt * __pyx_v_weighted_avg) + (__pyx_v_new_wt * __pyx_v_cur));
            __pyx_t_16 = (__pyx_v_old_wt + __pyx_v_new_wt);
            if (unlikely(__pyx_t_16 == 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 = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_v_weighted_avg = (__pyx_t_12 / __pyx_t_16);
            goto __pyx_L11;
          }
          __pyx_L11:;

          /* "pandas/algos.pyx":1014
 *                     if weighted_avg != cur:  # avoid numerical errors on constant series
 *                         weighted_avg = ((old_wt * weighted_avg) + (new_wt * cur)) / (old_wt + new_wt)
 *                     if adjust:             # <<<<<<<<<<<<<<
 *                         old_wt += new_wt
 *                     else:
 */
          __pyx_t_7 = (__pyx_v_adjust != 0);
          if (__pyx_t_7) {

            /* "pandas/algos.pyx":1015
 *                         weighted_avg = ((old_wt * weighted_avg) + (new_wt * cur)) / (old_wt + new_wt)
 *                     if adjust:
 *                         old_wt += new_wt             # <<<<<<<<<<<<<<
 *                     else:
 *                         old_wt = 1.
 */
            __pyx_v_old_wt = (__pyx_v_old_wt + __pyx_v_new_wt);
            goto __pyx_L12;
          }
          /*else*/ {

            /* "pandas/algos.pyx":1017
 *                         old_wt += new_wt
 *                     else:
 *                         old_wt = 1.             # <<<<<<<<<<<<<<
 *         elif is_observation:
 *             weighted_avg = cur
 */
            __pyx_v_old_wt = 1.;
          }
          __pyx_L12:;
          goto __pyx_L10;
        }
        __pyx_L10:;
        goto __pyx_L7;
      }
      __pyx_L7:;
      goto __pyx_L6;
    }

    /* "pandas/algos.pyx":1018
 *                     else:
 *                         old_wt = 1.
 *         elif is_observation:             # <<<<<<<<<<<<<<
 *             weighted_avg = cur
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_is_observation); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_7) {

      /* "pandas/algos.pyx":1019
 *                         old_wt = 1.
 *         elif is_observation:
 *             weighted_avg = cur             # <<<<<<<<<<<<<<
 * 
 *         output[i] = weighted_avg if (nobs >= minp) else NaN
 */
      __pyx_v_weighted_avg = __pyx_v_cur;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "pandas/algos.pyx":1021
 *             weighted_avg = cur
 * 
 *         output[i] = weighted_avg if (nobs >= minp) else NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
    if (((__pyx_v_nobs >= __pyx_v_minp) != 0)) {
      __pyx_t_16 = __pyx_v_weighted_avg;
    } else {
      __pyx_t_16 = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_14 >= __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 = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_t_16;
  }

  /* "pandas/algos.pyx":1023
 *         output[i] = weighted_avg if (nobs >= minp) else 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":967
 * # Exponentially weighted moving average
 * 
 * def ewma(ndarray[double_t] input, double_t com, int adjust, int ignore_na, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     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_XDECREF(__pyx_v_is_observation);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1028
 * # Exponentially weighted moving covariance
 * 
 * def ewmcov(ndarray[double_t] input_x, ndarray[double_t] input_y,             # <<<<<<<<<<<<<<
 *            double_t com, int adjust, int ignore_na, int minp, int bias):
 *     '''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_29ewmcov(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_28ewmcov[] = "\n    Compute exponentially-weighted moving variance using center-of-mass.\n\n    Parameters\n    ----------\n    input_x : ndarray (float64 type)\n    input_y : ndarray (float64 type)\n    com : float64\n    adjust: int\n    ignore_na: int\n    minp: int\n    bias: int\n\n    Returns\n    -------\n    y : ndarray\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_29ewmcov = {"ewmcov", (PyCFunction)__pyx_pw_6pandas_5algos_29ewmcov, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_28ewmcov};
static PyObject *__pyx_pw_6pandas_5algos_29ewmcov(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input_x = 0;
  PyArrayObject *__pyx_v_input_y = 0;
  __pyx_t_5numpy_double_t __pyx_v_com;
  int __pyx_v_adjust;
  int __pyx_v_ignore_na;
  int __pyx_v_minp;
  int __pyx_v_bias;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ewmcov (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_x,&__pyx_n_s_input_y,&__pyx_n_s_com,&__pyx_n_s_adjust,&__pyx_n_s_ignore_na,&__pyx_n_s_minp,&__pyx_n_s_bias,0};
    PyObject* values[7] = {0,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  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        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_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ewmcov", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_com)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ewmcov", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_adjust)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ewmcov", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ignore_na)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ewmcov", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ewmcov", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  6:
        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bias)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ewmcov", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ewmcov") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      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);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __pyx_v_input_x = ((PyArrayObject *)values[0]);
    __pyx_v_input_y = ((PyArrayObject *)values[1]);
    __pyx_v_com = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_com == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_adjust = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_adjust == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_ignore_na = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_ignore_na == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_bias = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_bias == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ewmcov", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.ewmcov", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input_x), __pyx_ptype_5numpy_ndarray, 1, "input_x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input_y), __pyx_ptype_5numpy_ndarray, 1, "input_y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_28ewmcov(__pyx_self, __pyx_v_input_x, __pyx_v_input_y, __pyx_v_com, __pyx_v_adjust, __pyx_v_ignore_na, __pyx_v_minp, __pyx_v_bias);

  /* 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_28ewmcov(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input_x, PyArrayObject *__pyx_v_input_y, __pyx_t_5numpy_double_t __pyx_v_com, int __pyx_v_adjust, int __pyx_v_ignore_na, int __pyx_v_minp, int __pyx_v_bias) {
  Py_ssize_t __pyx_v_N;
  PyArrayObject *__pyx_v_output = 0;
  double __pyx_v_alpha;
  double __pyx_v_old_wt_factor;
  double __pyx_v_new_wt;
  double __pyx_v_mean_x;
  double __pyx_v_mean_y;
  double __pyx_v_cov;
  double __pyx_v_sum_wt;
  double __pyx_v_sum_wt2;
  double __pyx_v_old_wt;
  double __pyx_v_cur_x;
  double __pyx_v_cur_y;
  double __pyx_v_old_mean_x;
  double __pyx_v_old_mean_y;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_nobs;
  PyObject *__pyx_v_is_observation = NULL;
  double __pyx_v_numerator;
  double __pyx_v_denominator;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_x;
  __Pyx_Buffer __pyx_pybuffer_input_x;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_y;
  __Pyx_Buffer __pyx_pybuffer_input_y;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_output;
  __Pyx_Buffer __pyx_pybuffer_output;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  long __pyx_t_8;
  int __pyx_t_9;
  long __pyx_t_10;
  __pyx_t_5numpy_double_t __pyx_t_11;
  double __pyx_t_12;
  int __pyx_t_13;
  double __pyx_t_14;
  long __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("ewmcov", 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_x.pybuffer.buf = NULL;
  __pyx_pybuffer_input_x.refcount = 0;
  __pyx_pybuffernd_input_x.data = NULL;
  __pyx_pybuffernd_input_x.rcbuffer = &__pyx_pybuffer_input_x;
  __pyx_pybuffer_input_y.pybuffer.buf = NULL;
  __pyx_pybuffer_input_y.refcount = 0;
  __pyx_pybuffernd_input_y.data = NULL;
  __pyx_pybuffernd_input_y.rcbuffer = &__pyx_pybuffer_input_y;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_input_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_input_x.diminfo[0].strides = __pyx_pybuffernd_input_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_x.diminfo[0].shape = __pyx_pybuffernd_input_x.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_input_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_input_y.diminfo[0].strides = __pyx_pybuffernd_input_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_y.diminfo[0].shape = __pyx_pybuffernd_input_y.rcbuffer->pybuffer.shape[0];

  /* "pandas/algos.pyx":1048
 *     '''
 * 
 *     cdef Py_ssize_t N = len(input_x)             # <<<<<<<<<<<<<<
 *     if len(input_y) != N:
 *         raise ValueError('arrays are of different lengths (%d and %d)' % (N, len(input_y)))
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input_x)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":1049
 * 
 *     cdef Py_ssize_t N = len(input_x)
 *     if len(input_y) != N:             # <<<<<<<<<<<<<<
 *         raise ValueError('arrays are of different lengths (%d and %d)' % (N, len(input_y)))
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input_y)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((__pyx_t_1 != __pyx_v_N) != 0);
  if (__pyx_t_2) {

    /* "pandas/algos.pyx":1050
 *     cdef Py_ssize_t N = len(input_x)
 *     if len(input_y) != N:
 *         raise ValueError('arrays are of different lengths (%d and %d)' % (N, len(input_y)))             # <<<<<<<<<<<<<<
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 *     if N == 0:
 */
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input_y)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __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);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_arrays_are_of_different_lengths, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/algos.pyx":1051
 *     if len(input_y) != N:
 *         raise ValueError('arrays are of different lengths (%d and %d)' % (N, len(input_y)))
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)             # <<<<<<<<<<<<<<
 *     if N == 0:
 *         return output
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __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 = 1051; __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 = 1051; __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 = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __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_3); __pyx_t_3 = 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[0]; __pyx_lineno = 1051; __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_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__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 = 1051; __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_7 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1052
 *         raise ValueError('arrays are of different lengths (%d and %d)' % (N, len(input_y)))
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return output
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/algos.pyx":1053
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 *     if N == 0:
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     minp = max(minp, 1)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_output));
    __pyx_r = ((PyObject *)__pyx_v_output);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":1055
 *         return output
 * 
 *     minp = max(minp, 1)             # <<<<<<<<<<<<<<
 * 
 *     cdef double alpha, old_wt_factor, new_wt, mean_x, mean_y, cov
 */
  __pyx_t_8 = 1;
  __pyx_t_9 = __pyx_v_minp;
  if (((__pyx_t_8 > __pyx_t_9) != 0)) {
    __pyx_t_10 = __pyx_t_8;
  } else {
    __pyx_t_10 = __pyx_t_9;
  }
  __pyx_v_minp = __pyx_t_10;

  /* "pandas/algos.pyx":1061
 *     cdef Py_ssize_t i, nobs
 * 
 *     alpha = 1. / (1. + com)             # <<<<<<<<<<<<<<
 *     old_wt_factor = 1. - alpha
 *     new_wt = 1. if adjust else alpha
 */
  __pyx_t_11 = (1. + __pyx_v_com);
  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 = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_alpha = (1. / __pyx_t_11);

  /* "pandas/algos.pyx":1062
 * 
 *     alpha = 1. / (1. + com)
 *     old_wt_factor = 1. - alpha             # <<<<<<<<<<<<<<
 *     new_wt = 1. if adjust else alpha
 * 
 */
  __pyx_v_old_wt_factor = (1. - __pyx_v_alpha);

  /* "pandas/algos.pyx":1063
 *     alpha = 1. / (1. + com)
 *     old_wt_factor = 1. - alpha
 *     new_wt = 1. if adjust else alpha             # <<<<<<<<<<<<<<
 * 
 *     mean_x = input_x[0]
 */
  if ((__pyx_v_adjust != 0)) {
    __pyx_t_12 = 1.;
  } else {
    __pyx_t_12 = __pyx_v_alpha;
  }
  __pyx_v_new_wt = __pyx_t_12;

  /* "pandas/algos.pyx":1065
 *     new_wt = 1. if adjust else alpha
 * 
 *     mean_x = input_x[0]             # <<<<<<<<<<<<<<
 *     mean_y = input_y[0]
 *     is_observation = ((mean_x == mean_x) and (mean_y == mean_y))
 */
  __pyx_t_10 = 0;
  __pyx_t_9 = -1;
  if (__pyx_t_10 < 0) {
    __pyx_t_10 += __pyx_pybuffernd_input_x.diminfo[0].shape;
    if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_input_x.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 = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_mean_x = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_input_x.diminfo[0].strides));

  /* "pandas/algos.pyx":1066
 * 
 *     mean_x = input_x[0]
 *     mean_y = input_y[0]             # <<<<<<<<<<<<<<
 *     is_observation = ((mean_x == mean_x) and (mean_y == mean_y))
 *     nobs = int(is_observation)
 */
  __pyx_t_8 = 0;
  __pyx_t_9 = -1;
  if (__pyx_t_8 < 0) {
    __pyx_t_8 += __pyx_pybuffernd_input_y.diminfo[0].shape;
    if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_input_y.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 = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_mean_y = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input_y.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_input_y.diminfo[0].strides));

  /* "pandas/algos.pyx":1067
 *     mean_x = input_x[0]
 *     mean_y = input_y[0]
 *     is_observation = ((mean_x == mean_x) and (mean_y == mean_y))             # <<<<<<<<<<<<<<
 *     nobs = int(is_observation)
 *     if not is_observation:
 */
  __pyx_t_2 = (__pyx_v_mean_x == __pyx_v_mean_x);
  if (__pyx_t_2) {
  } else {
    __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_mean_y == __pyx_v_mean_y);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_L5_bool_binop_done:;
  __pyx_v_is_observation = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1068
 *     mean_y = input_y[0]
 *     is_observation = ((mean_x == mean_x) and (mean_y == mean_y))
 *     nobs = int(is_observation)             # <<<<<<<<<<<<<<
 *     if not is_observation:
 *         mean_x = NaN
 */
  __pyx_t_6 = PyNumber_Int(__pyx_v_is_observation); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_nobs = __pyx_t_1;

  /* "pandas/algos.pyx":1069
 *     is_observation = ((mean_x == mean_x) and (mean_y == mean_y))
 *     nobs = int(is_observation)
 *     if not is_observation:             # <<<<<<<<<<<<<<
 *         mean_x = NaN
 *         mean_y = NaN
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_is_observation); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((!__pyx_t_2) != 0);
  if (__pyx_t_13) {

    /* "pandas/algos.pyx":1070
 *     nobs = int(is_observation)
 *     if not is_observation:
 *         mean_x = NaN             # <<<<<<<<<<<<<<
 *         mean_y = NaN
 *     output[0] = (0. if bias else NaN) if (nobs >= minp) else NaN
 */
    __pyx_v_mean_x = __pyx_v_6pandas_5algos_NaN;

    /* "pandas/algos.pyx":1071
 *     if not is_observation:
 *         mean_x = NaN
 *         mean_y = NaN             # <<<<<<<<<<<<<<
 *     output[0] = (0. if bias else NaN) if (nobs >= minp) else NaN
 *     cov = 0.
 */
    __pyx_v_mean_y = __pyx_v_6pandas_5algos_NaN;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pandas/algos.pyx":1072
 *         mean_x = NaN
 *         mean_y = NaN
 *     output[0] = (0. if bias else NaN) if (nobs >= minp) else NaN             # <<<<<<<<<<<<<<
 *     cov = 0.
 *     sum_wt = 1.
 */
  if (((__pyx_v_nobs >= __pyx_v_minp) != 0)) {
    if ((__pyx_v_bias != 0)) {
      __pyx_t_14 = 0.;
    } else {
      __pyx_t_14 = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_t_12 = __pyx_t_14;
  } else {
    __pyx_t_12 = __pyx_v_6pandas_5algos_NaN;
  }
  __pyx_t_15 = 0;
  __pyx_t_9 = -1;
  if (__pyx_t_15 < 0) {
    __pyx_t_15 += __pyx_pybuffernd_output.diminfo[0].shape;
    if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_15 >= __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 = 1072; __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_12;

  /* "pandas/algos.pyx":1073
 *         mean_y = NaN
 *     output[0] = (0. if bias else NaN) if (nobs >= minp) else NaN
 *     cov = 0.             # <<<<<<<<<<<<<<
 *     sum_wt = 1.
 *     sum_wt2 = 1.
 */
  __pyx_v_cov = 0.;

  /* "pandas/algos.pyx":1074
 *     output[0] = (0. if bias else NaN) if (nobs >= minp) else NaN
 *     cov = 0.
 *     sum_wt = 1.             # <<<<<<<<<<<<<<
 *     sum_wt2 = 1.
 *     old_wt = 1.
 */
  __pyx_v_sum_wt = 1.;

  /* "pandas/algos.pyx":1075
 *     cov = 0.
 *     sum_wt = 1.
 *     sum_wt2 = 1.             # <<<<<<<<<<<<<<
 *     old_wt = 1.
 * 
 */
  __pyx_v_sum_wt2 = 1.;

  /* "pandas/algos.pyx":1076
 *     sum_wt = 1.
 *     sum_wt2 = 1.
 *     old_wt = 1.             # <<<<<<<<<<<<<<
 * 
 *     for i from 1 <= i < N:
 */
  __pyx_v_old_wt = 1.;

  /* "pandas/algos.pyx":1078
 *     old_wt = 1.
 * 
 *     for i from 1 <= i < N:             # <<<<<<<<<<<<<<
 *         cur_x = input_x[i]
 *         cur_y = input_y[i]
 */
  __pyx_t_1 = __pyx_v_N;
  for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/algos.pyx":1079
 * 
 *     for i from 1 <= i < N:
 *         cur_x = input_x[i]             # <<<<<<<<<<<<<<
 *         cur_y = input_y[i]
 *         is_observation = ((cur_x == cur_x) and (cur_y == cur_y))
 */
    __pyx_t_16 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_pybuffernd_input_x.diminfo[0].shape;
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_input_x.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 = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_cur_x = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input_x.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_input_x.diminfo[0].strides));

    /* "pandas/algos.pyx":1080
 *     for i from 1 <= i < N:
 *         cur_x = input_x[i]
 *         cur_y = input_y[i]             # <<<<<<<<<<<<<<
 *         is_observation = ((cur_x == cur_x) and (cur_y == cur_y))
 *         nobs += int(is_observation)
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_pybuffernd_input_y.diminfo[0].shape;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_input_y.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 = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_cur_y = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input_y.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_input_y.diminfo[0].strides));

    /* "pandas/algos.pyx":1081
 *         cur_x = input_x[i]
 *         cur_y = input_y[i]
 *         is_observation = ((cur_x == cur_x) and (cur_y == cur_y))             # <<<<<<<<<<<<<<
 *         nobs += int(is_observation)
 *         if mean_x == mean_x:
 */
    __pyx_t_13 = (__pyx_v_cur_x == __pyx_v_cur_x);
    if (__pyx_t_13) {
    } else {
      __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_13); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_13 = (__pyx_v_cur_y == __pyx_v_cur_y);
    __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_13); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_L10_bool_binop_done:;
    __Pyx_DECREF_SET(__pyx_v_is_observation, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pandas/algos.pyx":1082
 *         cur_y = input_y[i]
 *         is_observation = ((cur_x == cur_x) and (cur_y == cur_y))
 *         nobs += int(is_observation)             # <<<<<<<<<<<<<<
 *         if mean_x == mean_x:
 *             if is_observation or (not ignore_na):
 */
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_nobs); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PyNumber_Int(__pyx_v_is_observation); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_nobs = __pyx_t_18;

    /* "pandas/algos.pyx":1083
 *         is_observation = ((cur_x == cur_x) and (cur_y == cur_y))
 *         nobs += int(is_observation)
 *         if mean_x == mean_x:             # <<<<<<<<<<<<<<
 *             if is_observation or (not ignore_na):
 *                 sum_wt *= old_wt_factor
 */
    __pyx_t_13 = ((__pyx_v_mean_x == __pyx_v_mean_x) != 0);
    if (__pyx_t_13) {

      /* "pandas/algos.pyx":1084
 *         nobs += int(is_observation)
 *         if mean_x == mean_x:
 *             if is_observation or (not ignore_na):             # <<<<<<<<<<<<<<
 *                 sum_wt *= old_wt_factor
 *                 sum_wt2 *= (old_wt_factor * old_wt_factor)
 */
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_is_observation); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (!__pyx_t_2) {
      } else {
        __pyx_t_13 = __pyx_t_2;
        goto __pyx_L14_bool_binop_done;
      }
      __pyx_t_2 = ((!(__pyx_v_ignore_na != 0)) != 0);
      __pyx_t_13 = __pyx_t_2;
      __pyx_L14_bool_binop_done:;
      if (__pyx_t_13) {

        /* "pandas/algos.pyx":1085
 *         if mean_x == mean_x:
 *             if is_observation or (not ignore_na):
 *                 sum_wt *= old_wt_factor             # <<<<<<<<<<<<<<
 *                 sum_wt2 *= (old_wt_factor * old_wt_factor)
 *                 old_wt *= old_wt_factor
 */
        __pyx_v_sum_wt = (__pyx_v_sum_wt * __pyx_v_old_wt_factor);

        /* "pandas/algos.pyx":1086
 *             if is_observation or (not ignore_na):
 *                 sum_wt *= old_wt_factor
 *                 sum_wt2 *= (old_wt_factor * old_wt_factor)             # <<<<<<<<<<<<<<
 *                 old_wt *= old_wt_factor
 *                 if is_observation:
 */
        __pyx_v_sum_wt2 = (__pyx_v_sum_wt2 * (__pyx_v_old_wt_factor * __pyx_v_old_wt_factor));

        /* "pandas/algos.pyx":1087
 *                 sum_wt *= old_wt_factor
 *                 sum_wt2 *= (old_wt_factor * old_wt_factor)
 *                 old_wt *= old_wt_factor             # <<<<<<<<<<<<<<
 *                 if is_observation:
 *                     old_mean_x = mean_x
 */
        __pyx_v_old_wt = (__pyx_v_old_wt * __pyx_v_old_wt_factor);

        /* "pandas/algos.pyx":1088
 *                 sum_wt2 *= (old_wt_factor * old_wt_factor)
 *                 old_wt *= old_wt_factor
 *                 if is_observation:             # <<<<<<<<<<<<<<
 *                     old_mean_x = mean_x
 *                     old_mean_y = mean_y
 */
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_is_observation); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__pyx_t_13) {

          /* "pandas/algos.pyx":1089
 *                 old_wt *= old_wt_factor
 *                 if is_observation:
 *                     old_mean_x = mean_x             # <<<<<<<<<<<<<<
 *                     old_mean_y = mean_y
 *                     if mean_x != cur_x:  # avoid numerical errors on constant series
 */
          __pyx_v_old_mean_x = __pyx_v_mean_x;

          /* "pandas/algos.pyx":1090
 *                 if is_observation:
 *                     old_mean_x = mean_x
 *                     old_mean_y = mean_y             # <<<<<<<<<<<<<<
 *                     if mean_x != cur_x:  # avoid numerical errors on constant series
 *                         mean_x = ((old_wt * old_mean_x) + (new_wt * cur_x)) / (old_wt + new_wt)
 */
          __pyx_v_old_mean_y = __pyx_v_mean_y;

          /* "pandas/algos.pyx":1091
 *                     old_mean_x = mean_x
 *                     old_mean_y = mean_y
 *                     if mean_x != cur_x:  # avoid numerical errors on constant series             # <<<<<<<<<<<<<<
 *                         mean_x = ((old_wt * old_mean_x) + (new_wt * cur_x)) / (old_wt + new_wt)
 *                     if mean_y != cur_y:  # avoid numerical errors on constant series
 */
          __pyx_t_13 = ((__pyx_v_mean_x != __pyx_v_cur_x) != 0);
          if (__pyx_t_13) {

            /* "pandas/algos.pyx":1092
 *                     old_mean_y = mean_y
 *                     if mean_x != cur_x:  # avoid numerical errors on constant series
 *                         mean_x = ((old_wt * old_mean_x) + (new_wt * cur_x)) / (old_wt + new_wt)             # <<<<<<<<<<<<<<
 *                     if mean_y != cur_y:  # avoid numerical errors on constant series
 *                         mean_y = ((old_wt * old_mean_y) + (new_wt * cur_y)) / (old_wt + new_wt)
 */
            __pyx_t_12 = ((__pyx_v_old_wt * __pyx_v_old_mean_x) + (__pyx_v_new_wt * __pyx_v_cur_x));
            __pyx_t_14 = (__pyx_v_old_wt + __pyx_v_new_wt);
            if (unlikely(__pyx_t_14 == 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_v_mean_x = (__pyx_t_12 / __pyx_t_14);
            goto __pyx_L17;
          }
          __pyx_L17:;

          /* "pandas/algos.pyx":1093
 *                     if mean_x != cur_x:  # avoid numerical errors on constant series
 *                         mean_x = ((old_wt * old_mean_x) + (new_wt * cur_x)) / (old_wt + new_wt)
 *                     if mean_y != cur_y:  # avoid numerical errors on constant series             # <<<<<<<<<<<<<<
 *                         mean_y = ((old_wt * old_mean_y) + (new_wt * cur_y)) / (old_wt + new_wt)
 *                     cov = ((old_wt * (cov + ((old_mean_x - mean_x) * (old_mean_y - mean_y)))) +
 */
          __pyx_t_13 = ((__pyx_v_mean_y != __pyx_v_cur_y) != 0);
          if (__pyx_t_13) {

            /* "pandas/algos.pyx":1094
 *                         mean_x = ((old_wt * old_mean_x) + (new_wt * cur_x)) / (old_wt + new_wt)
 *                     if mean_y != cur_y:  # avoid numerical errors on constant series
 *                         mean_y = ((old_wt * old_mean_y) + (new_wt * cur_y)) / (old_wt + new_wt)             # <<<<<<<<<<<<<<
 *                     cov = ((old_wt * (cov + ((old_mean_x - mean_x) * (old_mean_y - mean_y)))) +
 *                            (new_wt * ((cur_x - mean_x) * (cur_y - mean_y)))) / (old_wt + new_wt)
 */
            __pyx_t_14 = ((__pyx_v_old_wt * __pyx_v_old_mean_y) + (__pyx_v_new_wt * __pyx_v_cur_y));
            __pyx_t_12 = (__pyx_v_old_wt + __pyx_v_new_wt);
            if (unlikely(__pyx_t_12 == 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 = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_v_mean_y = (__pyx_t_14 / __pyx_t_12);
            goto __pyx_L18;
          }
          __pyx_L18:;

          /* "pandas/algos.pyx":1095
 *                     if mean_y != cur_y:  # avoid numerical errors on constant series
 *                         mean_y = ((old_wt * old_mean_y) + (new_wt * cur_y)) / (old_wt + new_wt)
 *                     cov = ((old_wt * (cov + ((old_mean_x - mean_x) * (old_mean_y - mean_y)))) +             # <<<<<<<<<<<<<<
 *                            (new_wt * ((cur_x - mean_x) * (cur_y - mean_y)))) / (old_wt + new_wt)
 *                     sum_wt += new_wt
 */
          __pyx_t_12 = ((__pyx_v_old_wt * (__pyx_v_cov + ((__pyx_v_old_mean_x - __pyx_v_mean_x) * (__pyx_v_old_mean_y - __pyx_v_mean_y)))) + (__pyx_v_new_wt * ((__pyx_v_cur_x - __pyx_v_mean_x) * (__pyx_v_cur_y - __pyx_v_mean_y))));

          /* "pandas/algos.pyx":1096
 *                         mean_y = ((old_wt * old_mean_y) + (new_wt * cur_y)) / (old_wt + new_wt)
 *                     cov = ((old_wt * (cov + ((old_mean_x - mean_x) * (old_mean_y - mean_y)))) +
 *                            (new_wt * ((cur_x - mean_x) * (cur_y - mean_y)))) / (old_wt + new_wt)             # <<<<<<<<<<<<<<
 *                     sum_wt += new_wt
 *                     sum_wt2 += (new_wt * new_wt)
 */
          __pyx_t_14 = (__pyx_v_old_wt + __pyx_v_new_wt);
          if (unlikely(__pyx_t_14 == 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 = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_v_cov = (__pyx_t_12 / __pyx_t_14);

          /* "pandas/algos.pyx":1097
 *                     cov = ((old_wt * (cov + ((old_mean_x - mean_x) * (old_mean_y - mean_y)))) +
 *                            (new_wt * ((cur_x - mean_x) * (cur_y - mean_y)))) / (old_wt + new_wt)
 *                     sum_wt += new_wt             # <<<<<<<<<<<<<<
 *                     sum_wt2 += (new_wt * new_wt)
 *                     old_wt += new_wt
 */
          __pyx_v_sum_wt = (__pyx_v_sum_wt + __pyx_v_new_wt);

          /* "pandas/algos.pyx":1098
 *                            (new_wt * ((cur_x - mean_x) * (cur_y - mean_y)))) / (old_wt + new_wt)
 *                     sum_wt += new_wt
 *                     sum_wt2 += (new_wt * new_wt)             # <<<<<<<<<<<<<<
 *                     old_wt += new_wt
 *                     if not adjust:
 */
          __pyx_v_sum_wt2 = (__pyx_v_sum_wt2 + (__pyx_v_new_wt * __pyx_v_new_wt));

          /* "pandas/algos.pyx":1099
 *                     sum_wt += new_wt
 *                     sum_wt2 += (new_wt * new_wt)
 *                     old_wt += new_wt             # <<<<<<<<<<<<<<
 *                     if not adjust:
 *                         sum_wt /= old_wt
 */
          __pyx_v_old_wt = (__pyx_v_old_wt + __pyx_v_new_wt);

          /* "pandas/algos.pyx":1100
 *                     sum_wt2 += (new_wt * new_wt)
 *                     old_wt += new_wt
 *                     if not adjust:             # <<<<<<<<<<<<<<
 *                         sum_wt /= old_wt
 *                         sum_wt2 /= (old_wt * old_wt)
 */
          __pyx_t_13 = ((!(__pyx_v_adjust != 0)) != 0);
          if (__pyx_t_13) {

            /* "pandas/algos.pyx":1101
 *                     old_wt += new_wt
 *                     if not adjust:
 *                         sum_wt /= old_wt             # <<<<<<<<<<<<<<
 *                         sum_wt2 /= (old_wt * old_wt)
 *                         old_wt = 1.
 */
            if (unlikely(__pyx_v_old_wt == 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 = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_v_sum_wt = (__pyx_v_sum_wt / __pyx_v_old_wt);

            /* "pandas/algos.pyx":1102
 *                     if not adjust:
 *                         sum_wt /= old_wt
 *                         sum_wt2 /= (old_wt * old_wt)             # <<<<<<<<<<<<<<
 *                         old_wt = 1.
 *         elif is_observation:
 */
            __pyx_t_14 = (__pyx_v_old_wt * __pyx_v_old_wt);
            if (unlikely(__pyx_t_14 == 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 = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_v_sum_wt2 = (__pyx_v_sum_wt2 / __pyx_t_14);

            /* "pandas/algos.pyx":1103
 *                         sum_wt /= old_wt
 *                         sum_wt2 /= (old_wt * old_wt)
 *                         old_wt = 1.             # <<<<<<<<<<<<<<
 *         elif is_observation:
 *             mean_x = cur_x
 */
            __pyx_v_old_wt = 1.;
            goto __pyx_L19;
          }
          __pyx_L19:;
          goto __pyx_L16;
        }
        __pyx_L16:;
        goto __pyx_L13;
      }
      __pyx_L13:;
      goto __pyx_L12;
    }

    /* "pandas/algos.pyx":1104
 *                         sum_wt2 /= (old_wt * old_wt)
 *                         old_wt = 1.
 *         elif is_observation:             # <<<<<<<<<<<<<<
 *             mean_x = cur_x
 *             mean_y = cur_y
 */
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_is_observation); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_13) {

      /* "pandas/algos.pyx":1105
 *                         old_wt = 1.
 *         elif is_observation:
 *             mean_x = cur_x             # <<<<<<<<<<<<<<
 *             mean_y = cur_y
 * 
 */
      __pyx_v_mean_x = __pyx_v_cur_x;

      /* "pandas/algos.pyx":1106
 *         elif is_observation:
 *             mean_x = cur_x
 *             mean_y = cur_y             # <<<<<<<<<<<<<<
 * 
 *         if nobs >= minp:
 */
      __pyx_v_mean_y = __pyx_v_cur_y;
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "pandas/algos.pyx":1108
 *             mean_y = cur_y
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             if not bias:
 *                 numerator = sum_wt * sum_wt
 */
    __pyx_t_13 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
    if (__pyx_t_13) {

      /* "pandas/algos.pyx":1109
 * 
 *         if nobs >= minp:
 *             if not bias:             # <<<<<<<<<<<<<<
 *                 numerator = sum_wt * sum_wt
 *                 denominator = numerator - sum_wt2
 */
      __pyx_t_13 = ((!(__pyx_v_bias != 0)) != 0);
      if (__pyx_t_13) {

        /* "pandas/algos.pyx":1110
 *         if nobs >= minp:
 *             if not bias:
 *                 numerator = sum_wt * sum_wt             # <<<<<<<<<<<<<<
 *                 denominator = numerator - sum_wt2
 *                 output[i] = ((numerator / denominator) * cov) if (denominator > 0.) else NaN
 */
        __pyx_v_numerator = (__pyx_v_sum_wt * __pyx_v_sum_wt);

        /* "pandas/algos.pyx":1111
 *             if not bias:
 *                 numerator = sum_wt * sum_wt
 *                 denominator = numerator - sum_wt2             # <<<<<<<<<<<<<<
 *                 output[i] = ((numerator / denominator) * cov) if (denominator > 0.) else NaN
 *             else:
 */
        __pyx_v_denominator = (__pyx_v_numerator - __pyx_v_sum_wt2);

        /* "pandas/algos.pyx":1112
 *                 numerator = sum_wt * sum_wt
 *                 denominator = numerator - sum_wt2
 *                 output[i] = ((numerator / denominator) * cov) if (denominator > 0.) else NaN             # <<<<<<<<<<<<<<
 *             else:
 *                 output[i] = cov
 */
        if (((__pyx_v_denominator > 0.) != 0)) {
          if (unlikely(__pyx_v_denominator == 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 = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_14 = ((__pyx_v_numerator / __pyx_v_denominator) * __pyx_v_cov);
        } else {
          __pyx_t_14 = __pyx_v_6pandas_5algos_NaN;
        }
        __pyx_t_18 = __pyx_v_i;
        __pyx_t_9 = -1;
        if (__pyx_t_18 < 0) {
          __pyx_t_18 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 0;
        } else if (unlikely(__pyx_t_18 >= __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 = 1112; __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_t_14;
        goto __pyx_L21;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1114
 *                 output[i] = ((numerator / denominator) * cov) if (denominator > 0.) else NaN
 *             else:
 *                 output[i] = cov             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_9 = -1;
        if (__pyx_t_19 < 0) {
          __pyx_t_19 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0;
        } else if (unlikely(__pyx_t_19 >= __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 = 1114; __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_cov;
      }
      __pyx_L21:;
      goto __pyx_L20;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1116
 *                 output[i] = cov
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_9 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_20 >= __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 = 1116; __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_L20:;
  }

  /* "pandas/algos.pyx":1118
 *             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":1028
 * # Exponentially weighted moving covariance
 * 
 * def ewmcov(ndarray[double_t] input_x, ndarray[double_t] input_y,             # <<<<<<<<<<<<<<
 *            double_t com, int adjust, int ignore_na, int minp, int bias):
 *     '''
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_x.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_y.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.algos.ewmcov", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_x.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_y.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XDECREF(__pyx_v_is_observation);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/algos.pyx":1125
 * @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_31nancorr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_31nancorr = {"nancorr", (PyCFunction)__pyx_pw_6pandas_5algos_31nancorr, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_31nancorr(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 = 1125; __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 = 1125; __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 = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_30nancorr(__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_30nancorr(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;
  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_float64_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;
  double __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;
  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 = 1125; __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":1130
 *         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":1133
 *         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 = 1133; __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 = 1133; __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 = 1133; __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 = 1133; __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 = 1133; __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 = 1133; __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 = 1133; __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 = 1133; __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 = 1133; __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":1135
 *     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":1136
 * 
 *     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":1138
 *         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 = 1138; __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 = 1138; __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 = 1138; __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 = 1138; __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 = 1138; __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 = 1138; __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 = 1138; __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 = 1138; __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 = 1138; __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 = 1138; __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 = 1138; __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 = 1138; __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 = 1138; __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":1139
 * 
 *     result = np.empty((K, K), dtype=np.float64)
 *     mask = np.isfinite(mat).view(np.uint8)             # <<<<<<<<<<<<<<
 * 
 *     for xi in range(K):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isfinite); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_mat)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_mat));
    PyTuple_SET_ITEM(__pyx_t_1, 0+1, ((PyObject *)__pyx_v_mat));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_mat));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_10);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __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 = NULL;
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __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_3); __pyx_t_3 = 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 = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_16 = ((PyArrayObject *)__pyx_t_10);
  {
    __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 = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_16 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "pandas/algos.pyx":1141
 *     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":1142
 * 
 *     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":1143
 *     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.0;
      __pyx_v_sumyy = 0.0;
      __pyx_v_sumx = 0.0;
      __pyx_v_sumy = 0.0;

      /* "pandas/algos.pyx":1144
 *         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":1145
 *             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_8 = ((*__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_8) {
        } else {
          __pyx_t_9 = __pyx_t_8;
          goto __pyx_L13_bool_binop_done;
        }
        __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_9 = __pyx_t_8;
        __pyx_L13_bool_binop_done:;
        if (__pyx_t_9) {

          /* "pandas/algos.pyx":1146
 *             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_25 = __pyx_v_i;
          __pyx_t_26 = __pyx_v_xi;
          __pyx_v_vx = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_mat.diminfo[1].strides));

          /* "pandas/algos.pyx":1147
 *                 if mask[i, xi] and mask[i, yi]:
 *                     vx = mat[i, xi]
 *                     vy = mat[i, yi]             # <<<<<<<<<<<<<<
 *                     nobs += 1
 *                     sumx += vx
 */
          __pyx_t_27 = __pyx_v_i;
          __pyx_t_28 = __pyx_v_yi;
          __pyx_v_vy = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_mat.diminfo[1].strides));

          /* "pandas/algos.pyx":1148
 *                     vx = mat[i, xi]
 *                     vy = mat[i, yi]
 *                     nobs += 1             # <<<<<<<<<<<<<<
 *                     sumx += vx
 *                     sumy += vy
 */
          __pyx_v_nobs = (__pyx_v_nobs + 1);

          /* "pandas/algos.pyx":1149
 *                     vy = mat[i, yi]
 *                     nobs += 1
 *                     sumx += vx             # <<<<<<<<<<<<<<
 *                     sumy += vy
 * 
 */
          __pyx_v_sumx = (__pyx_v_sumx + __pyx_v_vx);

          /* "pandas/algos.pyx":1150
 *                     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":1152
 *                     sumy += vy
 * 
 *             if nobs < minp:             # <<<<<<<<<<<<<<
 *                 result[xi, yi] = result[yi, xi] = np.NaN
 *             else:
 */
      __pyx_t_10 = __Pyx_PyInt_From_npy_int64(__pyx_v_nobs); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_10, __pyx_v_minp, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_9) {

        /* "pandas/algos.pyx":1153
 * 
 *             if nobs < minp:
 *                 result[xi, yi] = result[yi, xi] = np.NaN             # <<<<<<<<<<<<<<
 *             else:
 *                 meanx = sumx / nobs
 */
        __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NaN); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_29 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_29 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __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_29;
        __pyx_t_30 = __pyx_v_yi;
        __pyx_t_31 = __pyx_v_xi;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_29;
        goto __pyx_L15;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1155
 *                 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 = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_meanx = (__pyx_v_sumx / __pyx_v_nobs);

        /* "pandas/algos.pyx":1156
 *             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 = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_meany = (__pyx_v_sumy / __pyx_v_nobs);

        /* "pandas/algos.pyx":1159
 * 
 *                 # now the cov numerator
 *                 sumx = 0             # <<<<<<<<<<<<<<
 * 
 *                 for i in range(N):
 */
        __pyx_v_sumx = 0.0;

        /* "pandas/algos.pyx":1161
 *                 sumx = 0
 * 
 *                 for i in range(N):             # <<<<<<<<<<<<<<
 *                     if mask[i, xi] and mask[i, yi]:
 *                         vx = mat[i, xi] - meanx
 */
        __pyx_t_32 = __pyx_v_N;
        for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) {
          __pyx_v_i = __pyx_t_33;

          /* "pandas/algos.pyx":1162
 * 
 *                 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_34 = __pyx_v_i;
          __pyx_t_35 = __pyx_v_xi;
          __pyx_t_8 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
          if (__pyx_t_8) {
          } else {
            __pyx_t_9 = __pyx_t_8;
            goto __pyx_L19_bool_binop_done;
          }
          __pyx_t_36 = __pyx_v_i;
          __pyx_t_37 = __pyx_v_yi;
          __pyx_t_8 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
          __pyx_t_9 = __pyx_t_8;
          __pyx_L19_bool_binop_done:;
          if (__pyx_t_9) {

            /* "pandas/algos.pyx":1163
 *                 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_38 = __pyx_v_i;
            __pyx_t_39 = __pyx_v_xi;
            __pyx_v_vx = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_mat.diminfo[1].strides)) - __pyx_v_meanx);

            /* "pandas/algos.pyx":1164
 *                     if mask[i, xi] and mask[i, yi]:
 *                         vx = mat[i, xi] - meanx
 *                         vy = mat[i, yi] - meany             # <<<<<<<<<<<<<<
 * 
 *                         sumx += vx * vy
 */
            __pyx_t_40 = __pyx_v_i;
            __pyx_t_41 = __pyx_v_yi;
            __pyx_v_vy = ((*__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)) - __pyx_v_meany);

            /* "pandas/algos.pyx":1166
 *                         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":1167
 * 
 *                         sumx += vx * vy
 *                         sumxx += vx * vx             # <<<<<<<<<<<<<<
 *                         sumyy += vy * vy
 * 
 */
            __pyx_v_sumxx = (__pyx_v_sumxx + (__pyx_v_vx * __pyx_v_vx));

            /* "pandas/algos.pyx":1168
 *                         sumx += vx * vy
 *                         sumxx += vx * vx
 *                         sumyy += vy * vy             # <<<<<<<<<<<<<<
 * 
 *                 divisor = (nobs - 1.0) if cov else sqrt(sumxx * sumyy)
 */
            __pyx_v_sumyy = (__pyx_v_sumyy + (__pyx_v_vy * __pyx_v_vy));
            goto __pyx_L18;
          }
          __pyx_L18:;
        }

        /* "pandas/algos.pyx":1170
 *                         sumyy += vy * vy
 * 
 *                 divisor = (nobs - 1.0) if cov else sqrt(sumxx * sumyy)             # <<<<<<<<<<<<<<
 * 
 *                 if divisor != 0:
 */
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_cov); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__pyx_t_9) {
          __pyx_t_42 = (__pyx_v_nobs - 1.0);
        } else {
          __pyx_t_42 = sqrt((__pyx_v_sumxx * __pyx_v_sumyy));
        }
        __pyx_v_divisor = __pyx_t_42;

        /* "pandas/algos.pyx":1172
 *                 divisor = (nobs - 1.0) if cov else sqrt(sumxx * sumyy)
 * 
 *                 if divisor != 0:             # <<<<<<<<<<<<<<
 *                     result[xi, yi] = result[yi, xi] = sumx / divisor
 *                 else:
 */
        __pyx_t_9 = ((__pyx_v_divisor != 0.0) != 0);
        if (__pyx_t_9) {

          /* "pandas/algos.pyx":1173
 * 
 *                 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 = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_29 = (__pyx_v_sumx / __pyx_v_divisor);
          __pyx_t_32 = __pyx_v_xi;
          __pyx_t_33 = __pyx_v_yi;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_29;
          __pyx_t_43 = __pyx_v_yi;
          __pyx_t_44 = __pyx_v_xi;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_29;
          goto __pyx_L21;
        }
        /*else*/ {

          /* "pandas/algos.pyx":1175
 *                     result[xi, yi] = result[yi, xi] = sumx / divisor
 *                 else:
 *                     result[xi, yi] = result[yi, xi] = np.NaN             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
          __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_NaN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_29 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_29 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_45 = __pyx_v_xi;
          __pyx_t_46 = __pyx_v_yi;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_29;
          __pyx_t_47 = __pyx_v_yi;
          __pyx_t_48 = __pyx_v_xi;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_29;
        }
        __pyx_L21:;
      }
      __pyx_L15:;
    }
  }

  /* "pandas/algos.pyx":1177
 *                     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":1125
 * @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":1184
 * @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_33nancorr_spearman(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_33nancorr_spearman = {"nancorr_spearman", (PyCFunction)__pyx_pw_6pandas_5algos_33nancorr_spearman, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_33nancorr_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 = 1184; __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 = 1184; __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 = 1184; __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 = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_32nancorr_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_32nancorr_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;
  int __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  int __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;
  PyArrayObject *__pyx_t_28 = NULL;
  PyArrayObject *__pyx_t_29 = NULL;
  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;
  __pyx_t_5numpy_int64_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("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 = 1184; __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":1191
 *         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":1194
 *         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 = 1194; __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 = 1194; __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 = 1194; __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 = 1194; __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 = 1194; __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 = 1194; __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 = 1194; __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 = 1194; __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 = 1194; __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":1196
 *     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 = 1196; __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 = 1196; __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 = 1196; __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 = 1196; __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 = 1196; __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 = 1196; __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 = 1196; __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 = 1196; __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 = 1196; __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 = 1196; __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 = 1196; __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 = 1196; __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 = 1196; __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":1197
 * 
 *     result = np.empty((K, K), dtype=np.float64)
 *     mask = np.isfinite(mat).view(np.uint8)             # <<<<<<<<<<<<<<
 * 
 *     for xi in range(K):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isfinite); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_mat)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_mat));
    PyTuple_SET_ITEM(__pyx_t_1, 0+1, ((PyObject *)__pyx_v_mat));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_mat));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_8);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __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 = NULL;
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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 = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_8);
  {
    __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 = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pandas/algos.pyx":1199
 *     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":1200
 * 
 *     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":1201
 *     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":1202
 *         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":1203
 *             nobs = 0
 *             for i in range(N):
 *                 if mask[i, xi] and mask[i, yi]:             # <<<<<<<<<<<<<<
 *                     nobs += 1
 * 
 */
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_21 = __pyx_v_xi;
        __pyx_t_22 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
        if (__pyx_t_22) {
        } else {
          __pyx_t_19 = __pyx_t_22;
          goto __pyx_L12_bool_binop_done;
        }
        __pyx_t_23 = __pyx_v_i;
        __pyx_t_24 = __pyx_v_yi;
        __pyx_t_22 = ((*__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_19 = __pyx_t_22;
        __pyx_L12_bool_binop_done:;
        if (__pyx_t_19) {

          /* "pandas/algos.pyx":1204
 *             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":1206
 *                     nobs += 1
 * 
 *             if nobs < minp:             # <<<<<<<<<<<<<<
 *                 result[xi, yi] = result[yi, xi] = np.NaN
 *             else:
 */
      __pyx_t_19 = ((__pyx_v_nobs < __pyx_v_minp) != 0);
      if (__pyx_t_19) {

        /* "pandas/algos.pyx":1207
 * 
 *             if nobs < minp:
 *                 result[xi, yi] = result[yi, xi] = np.NaN             # <<<<<<<<<<<<<<
 *             else:
 *                 maskedx = np.empty(nobs, dtype=np.float64)
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_NaN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_25 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __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_25;
        __pyx_t_26 = __pyx_v_yi;
        __pyx_t_27 = __pyx_v_xi;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_25;
        goto __pyx_L14;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1209
 *                 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_nobs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __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 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __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;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_28 = ((PyArrayObject *)__pyx_t_4);
        {
          __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_28, &__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 = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_28 = 0;
        __Pyx_XDECREF_SET(__pyx_v_maskedx, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "pandas/algos.pyx":1210
 *             else:
 *                 maskedx = np.empty(nobs, dtype=np.float64)
 *                 maskedy = np.empty(nobs, dtype=np.float64)             # <<<<<<<<<<<<<<
 *                 j = 0
 *                 for i in range(N):
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __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[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_nobs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __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 = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_29 = ((PyArrayObject *)__pyx_t_1);
        {
          __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_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_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 = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_29 = 0;
        __Pyx_XDECREF_SET(__pyx_v_maskedy, ((PyArrayObject *)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "pandas/algos.pyx":1211
 *                 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":1212
 *                 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_30 = __pyx_v_N;
        for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) {
          __pyx_v_i = __pyx_t_31;

          /* "pandas/algos.pyx":1213
 *                 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_32 = __pyx_v_i;
          __pyx_t_33 = __pyx_v_xi;
          __pyx_t_22 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
          if (__pyx_t_22) {
          } else {
            __pyx_t_19 = __pyx_t_22;
            goto __pyx_L18_bool_binop_done;
          }
          __pyx_t_34 = __pyx_v_i;
          __pyx_t_35 = __pyx_v_yi;
          __pyx_t_22 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0);
          __pyx_t_19 = __pyx_t_22;
          __pyx_L18_bool_binop_done:;
          if (__pyx_t_19) {

            /* "pandas/algos.pyx":1214
 *                 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_36 = __pyx_v_i;
            __pyx_t_37 = __pyx_v_xi;
            __pyx_t_38 = __pyx_v_j;
            *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_maskedx.diminfo[0].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_mat.diminfo[1].strides));

            /* "pandas/algos.pyx":1215
 *                     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_39 = __pyx_v_i;
            __pyx_t_40 = __pyx_v_yi;
            __pyx_t_41 = __pyx_v_j;
            *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_maskedy.diminfo[0].strides) = (*__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));

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

        /* "pandas/algos.pyx":1217
 *                         maskedy[j] = mat[i, yi]
 *                         j += 1
 *                 maskedx = rank_1d_float64(maskedx)             # <<<<<<<<<<<<<<
 *                 maskedy = rank_1d_float64(maskedy)
 * 
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_rank_1d_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        if (!__pyx_t_2) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_maskedx)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
        } else {
          __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __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 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_maskedx));
          PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_maskedx));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_maskedx));
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_28 = ((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_28, &__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 = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_28 = 0;
        __Pyx_DECREF_SET(__pyx_v_maskedx, ((PyArrayObject *)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "pandas/algos.pyx":1218
 *                         j += 1
 *                 maskedx = rank_1d_float64(maskedx)
 *                 maskedy = rank_1d_float64(maskedy)             # <<<<<<<<<<<<<<
 * 
 *                 mean = (nobs + 1) / 2.
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_rank_1d_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        if (!__pyx_t_3) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_maskedy)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
        } else {
          __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __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 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_maskedy));
          PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_maskedy));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_maskedy));
          __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 = 1218; __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;
        if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_29 = ((PyArrayObject *)__pyx_t_1);
        {
          __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_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_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 = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_29 = 0;
        __Pyx_DECREF_SET(__pyx_v_maskedy, ((PyArrayObject *)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "pandas/algos.pyx":1220
 *                 maskedy = rank_1d_float64(maskedy)
 * 
 *                 mean = (nobs + 1) / 2.             # <<<<<<<<<<<<<<
 * 
 *                 # now the cov numerator
 */
        __pyx_v_mean = ((__pyx_v_nobs + 1) / 2.);

        /* "pandas/algos.pyx":1223
 * 
 *                 # now the cov numerator
 *                 sumx = sumxx = sumyy = 0             # <<<<<<<<<<<<<<
 * 
 *                 for i in range(nobs):
 */
        __pyx_v_sumx = 0.0;
        __pyx_v_sumxx = 0.0;
        __pyx_v_sumyy = 0.0;

        /* "pandas/algos.pyx":1225
 *                 sumx = sumxx = sumyy = 0
 * 
 *                 for i in range(nobs):             # <<<<<<<<<<<<<<
 *                     vx = maskedx[i] - mean
 *                     vy = maskedy[i] - mean
 */
        __pyx_t_42 = __pyx_v_nobs;
        for (__pyx_t_30 = 0; __pyx_t_30 < __pyx_t_42; __pyx_t_30+=1) {
          __pyx_v_i = __pyx_t_30;

          /* "pandas/algos.pyx":1226
 * 
 *                 for i in range(nobs):
 *                     vx = maskedx[i] - mean             # <<<<<<<<<<<<<<
 *                     vy = maskedy[i] - mean
 * 
 */
          __pyx_t_31 = __pyx_v_i;
          __pyx_v_vx = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_maskedx.diminfo[0].strides)) - __pyx_v_mean);

          /* "pandas/algos.pyx":1227
 *                 for i in range(nobs):
 *                     vx = maskedx[i] - mean
 *                     vy = maskedy[i] - mean             # <<<<<<<<<<<<<<
 * 
 *                     sumx += vx * vy
 */
          __pyx_t_43 = __pyx_v_i;
          __pyx_v_vy = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_maskedy.diminfo[0].strides)) - __pyx_v_mean);

          /* "pandas/algos.pyx":1229
 *                     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":1230
 * 
 *                     sumx += vx * vy
 *                     sumxx += vx * vx             # <<<<<<<<<<<<<<
 *                     sumyy += vy * vy
 * 
 */
          __pyx_v_sumxx = (__pyx_v_sumxx + (__pyx_v_vx * __pyx_v_vx));

          /* "pandas/algos.pyx":1231
 *                     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":1233
 *                     sumyy += vy * vy
 * 
 *                 divisor = sqrt(sumxx * sumyy)             # <<<<<<<<<<<<<<
 * 
 *                 if divisor != 0:
 */
        __pyx_v_divisor = sqrt((__pyx_v_sumxx * __pyx_v_sumyy));

        /* "pandas/algos.pyx":1235
 *                 divisor = sqrt(sumxx * sumyy)
 * 
 *                 if divisor != 0:             # <<<<<<<<<<<<<<
 *                     result[xi, yi] = result[yi, xi] = sumx / divisor
 *                 else:
 */
        __pyx_t_19 = ((__pyx_v_divisor != 0.0) != 0);
        if (__pyx_t_19) {

          /* "pandas/algos.pyx":1236
 * 
 *                 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 = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_25 = (__pyx_v_sumx / __pyx_v_divisor);
          __pyx_t_30 = __pyx_v_xi;
          __pyx_t_44 = __pyx_v_yi;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_25;
          __pyx_t_45 = __pyx_v_yi;
          __pyx_t_46 = __pyx_v_xi;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_25;
          goto __pyx_L22;
        }
        /*else*/ {

          /* "pandas/algos.pyx":1238
 *                     result[xi, yi] = result[yi, xi] = sumx / divisor
 *                 else:
 *                     result[xi, yi] = result[yi, xi] = np.NaN             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_NaN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_25 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_47 = __pyx_v_xi;
          __pyx_t_48 = __pyx_v_yi;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_25;
          __pyx_t_49 = __pyx_v_yi;
          __pyx_t_50 = __pyx_v_xi;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_25;
        }
        __pyx_L22:;
      }
      __pyx_L14:;
    }
  }

  /* "pandas/algos.pyx":1240
 *                     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":1184
 * @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":1245
 * # 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_35roll_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_34roll_var[] = "\n    Numerically stable implementation using Welford's method.\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_35roll_var = {"roll_var", (PyCFunction)__pyx_pw_6pandas_5algos_35roll_var, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_34roll_var};
static PyObject *__pyx_pw_6pandas_5algos_35roll_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 = 1245; __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 = 1245; __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 = 1245; __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 = 1245; __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 = 1245; __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 = 1245; __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 = 1245; __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 = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_34roll_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_34roll_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;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  double __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("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 = 1245; __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":1249
 *     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":1251
 *     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 = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":1253
 *     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 = 1253; __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 = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __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 = 1253; __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 = 1253; __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 = 1253; __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 = 1253; __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 = 1253; __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 = 1253; __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 ndarray[double_t] output = np.empty(N, dtype=float)
 * 
 *     minp = _check_minp(win, minp, N)             # <<<<<<<<<<<<<<
 * 
 *     # Check for windows larger than array, addresses #7297
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); 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_win); 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 = __Pyx_PyInt_From_int(__pyx_v_minp); 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 = PyInt_FromSsize_t(__pyx_v_N); 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);
  __pyx_t_8 = NULL;
  __pyx_t_1 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_1 = 1;
    }
  }
  __pyx_t_9 = PyTuple_New(3+__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  if (__pyx_t_8) {
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
  }
  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_1, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_7 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); 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_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_minp = __pyx_t_10;

  /* "pandas/algos.pyx":1258
 * 
 *     # Check for windows larger than array, addresses #7297
 *     win = min(win, N)             # <<<<<<<<<<<<<<
 * 
 *     # Over the first window, observations can only be added, never removed
 */
  __pyx_t_1 = __pyx_v_N;
  __pyx_t_10 = __pyx_v_win;
  if (((__pyx_t_1 < __pyx_t_10) != 0)) {
    __pyx_t_11 = __pyx_t_1;
  } else {
    __pyx_t_11 = __pyx_t_10;
  }
  __pyx_v_win = __pyx_t_11;

  /* "pandas/algos.pyx":1261
 * 
 *     # Over the first window, observations can only be added, never removed
 *     for i from 0 <= i < win:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_10 = __pyx_v_win;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_10; __pyx_v_i++) {

    /* "pandas/algos.pyx":1262
 *     # Over the first window, observations can only be added, never removed
 *     for i from 0 <= i < win:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_11 = __pyx_v_i;
    __pyx_t_12 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_input.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 = 1262; __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_11, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1265
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             delta = (val - mean_x)
 */
    __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_13) {

      /* "pandas/algos.pyx":1266
 *         # 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":1267
 *         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":1268
 *             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 = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_mean_x = (__pyx_v_mean_x + (__pyx_v_delta / __pyx_v_nobs));

      /* "pandas/algos.pyx":1269
 *             delta = (val - mean_x)
 *             mean_x += delta / nobs
 *             ssqdm_x += delta * (val - mean_x)             # <<<<<<<<<<<<<<
 * 
 *         if (nobs >= minp) and (nobs > ddof):
 */
      __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":1271
 *             ssqdm_x += delta * (val - mean_x)
 * 
 *         if (nobs >= minp) and (nobs > ddof):             # <<<<<<<<<<<<<<
 *             #pathological case
 *             if nobs == 1:
 */
    __pyx_t_14 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
    if (__pyx_t_14) {
    } else {
      __pyx_t_13 = __pyx_t_14;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_14 = ((__pyx_v_nobs > __pyx_v_ddof) != 0);
    __pyx_t_13 = __pyx_t_14;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_13) {

      /* "pandas/algos.pyx":1273
 *         if (nobs >= minp) and (nobs > ddof):
 *             #pathological case
 *             if nobs == 1:             # <<<<<<<<<<<<<<
 *                 val = 0
 *             else:
 */
      __pyx_t_13 = ((__pyx_v_nobs == 1.0) != 0);
      if (__pyx_t_13) {

        /* "pandas/algos.pyx":1274
 *             #pathological case
 *             if nobs == 1:
 *                 val = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 val = ssqdm_x / (nobs - ddof)
 */
        __pyx_v_val = 0.0;
        goto __pyx_L9;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1276
 *                 val = 0
 *             else:
 *                 val = ssqdm_x / (nobs - ddof)             # <<<<<<<<<<<<<<
 *                 if val < 0:
 *                     val = 0
 */
        __pyx_t_15 = (__pyx_v_nobs - __pyx_v_ddof);
        if (unlikely(__pyx_t_15 == 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 = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_val = (__pyx_v_ssqdm_x / __pyx_t_15);

        /* "pandas/algos.pyx":1277
 *             else:
 *                 val = ssqdm_x / (nobs - ddof)
 *                 if val < 0:             # <<<<<<<<<<<<<<
 *                     val = 0
 *         else:
 */
        __pyx_t_13 = ((__pyx_v_val < 0.0) != 0);
        if (__pyx_t_13) {

          /* "pandas/algos.pyx":1278
 *                 val = ssqdm_x / (nobs - ddof)
 *                 if val < 0:
 *                     val = 0             # <<<<<<<<<<<<<<
 *         else:
 *             val = NaN
 */
          __pyx_v_val = 0.0;
          goto __pyx_L10;
        }
        __pyx_L10:;
      }
      __pyx_L9:;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1280
 *                     val = 0
 *         else:
 *             val = NaN             # <<<<<<<<<<<<<<
 * 
 *         output[i] = val
 */
      __pyx_v_val = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_L6:;

    /* "pandas/algos.pyx":1282
 *             val = NaN
 * 
 *         output[i] = val             # <<<<<<<<<<<<<<
 * 
 *     # After the first window, observations can both be added and removed
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_12 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_12 = 0;
    } else if (unlikely(__pyx_t_1 >= __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 = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_val;
  }

  /* "pandas/algos.pyx":1285
 * 
 *     # After the first window, observations can both be added and removed
 *     for i from win <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 *         prev = input[i - win]
 */
  __pyx_t_16 = __pyx_v_N;
  for (__pyx_v_i = __pyx_v_win; __pyx_v_i < __pyx_t_16; __pyx_v_i++) {

    /* "pandas/algos.pyx":1286
 *     # After the first window, observations can both be added and removed
 *     for i from win <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 *         prev = input[i - win]
 * 
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_17 >= __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 = 1286; __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_17, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1287
 *     for i from win <= i < N:
 *         val = input[i]
 *         prev = input[i - win]             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
    __pyx_t_18 = (__pyx_v_i - __pyx_v_win);
    __pyx_t_10 = -1;
    if (__pyx_t_18 < 0) {
      __pyx_t_18 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_18 >= __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 = 1287; __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_18, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1289
 *         prev = input[i - win]
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             if prev == prev:
 *                 # Adding one observation and removing another one
 */
    __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_13) {

      /* "pandas/algos.pyx":1290
 * 
 *         if val == val:
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 # Adding one observation and removing another one
 *                 delta = val - prev
 */
      __pyx_t_13 = ((__pyx_v_prev == __pyx_v_prev) != 0);
      if (__pyx_t_13) {

        /* "pandas/algos.pyx":1292
 *             if prev == prev:
 *                 # Adding one observation and removing another one
 *                 delta = val - prev             # <<<<<<<<<<<<<<
 *                 prev -= mean_x
 *                 mean_x += delta / nobs
 */
        __pyx_v_delta = (__pyx_v_val - __pyx_v_prev);

        /* "pandas/algos.pyx":1293
 *                 # Adding one observation and removing another one
 *                 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":1294
 *                 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 = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_mean_x = (__pyx_v_mean_x + (__pyx_v_delta / __pyx_v_nobs));

        /* "pandas/algos.pyx":1295
 *                 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":1296
 *                 mean_x += delta / nobs
 *                 val -= mean_x
 *                 ssqdm_x += (val + prev) * delta             # <<<<<<<<<<<<<<
 *             else:
 *                 # Adding one observation and not removing any
 */
        __pyx_v_ssqdm_x = (__pyx_v_ssqdm_x + ((__pyx_v_val + __pyx_v_prev) * __pyx_v_delta));
        goto __pyx_L14;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1299
 *             else:
 *                 # Adding one observation and not removing any
 *                 nobs += 1             # <<<<<<<<<<<<<<
 *                 delta = (val - mean_x)
 *                 mean_x += delta / nobs
 */
        __pyx_v_nobs = (__pyx_v_nobs + 1.0);

        /* "pandas/algos.pyx":1300
 *                 # Adding one observation and not removing any
 *                 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":1301
 *                 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 = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_mean_x = (__pyx_v_mean_x + (__pyx_v_delta / __pyx_v_nobs));

        /* "pandas/algos.pyx":1302
 *                 delta = (val - mean_x)
 *                 mean_x += delta / nobs
 *                 ssqdm_x += delta * (val - mean_x)             # <<<<<<<<<<<<<<
 *         elif prev == prev:
 *             # Adding no new observation, but removing one
 */
        __pyx_v_ssqdm_x = (__pyx_v_ssqdm_x + (__pyx_v_delta * (__pyx_v_val - __pyx_v_mean_x)));
      }
      __pyx_L14:;
      goto __pyx_L13;
    }

    /* "pandas/algos.pyx":1303
 *                 mean_x += delta / nobs
 *                 ssqdm_x += delta * (val - mean_x)
 *         elif prev == prev:             # <<<<<<<<<<<<<<
 *             # Adding no new observation, but removing one
 *             nobs -= 1
 */
    __pyx_t_13 = ((__pyx_v_prev == __pyx_v_prev) != 0);
    if (__pyx_t_13) {

      /* "pandas/algos.pyx":1305
 *         elif prev == prev:
 *             # Adding no new observation, but removing one
 *             nobs -= 1             # <<<<<<<<<<<<<<
 *             if nobs:
 *                 delta = (prev - mean_x)
 */
      __pyx_v_nobs = (__pyx_v_nobs - 1.0);

      /* "pandas/algos.pyx":1306
 *             # Adding no new observation, but removing one
 *             nobs -= 1
 *             if nobs:             # <<<<<<<<<<<<<<
 *                 delta = (prev - mean_x)
 *                 mean_x -= delta  / nobs
 */
      __pyx_t_13 = (__pyx_v_nobs != 0);
      if (__pyx_t_13) {

        /* "pandas/algos.pyx":1307
 *             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":1308
 *             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 = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_mean_x = (__pyx_v_mean_x - (__pyx_v_delta / __pyx_v_nobs));

        /* "pandas/algos.pyx":1309
 *                 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_L15;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1311
 *                 ssqdm_x -= delta * (prev - mean_x)
 *             else:
 *                 mean_x = 0             # <<<<<<<<<<<<<<
 *                 ssqdm_x = 0
 *         # Variance is unchanged if no observation is added or removed
 */
        __pyx_v_mean_x = 0.0;

        /* "pandas/algos.pyx":1312
 *             else:
 *                 mean_x = 0
 *                 ssqdm_x = 0             # <<<<<<<<<<<<<<
 *         # Variance is unchanged if no observation is added or removed
 * 
 */
        __pyx_v_ssqdm_x = 0.0;
      }
      __pyx_L15:;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pandas/algos.pyx":1315
 *         # Variance is unchanged if no observation is added or removed
 * 
 *         if (nobs >= minp) and (nobs > ddof):             # <<<<<<<<<<<<<<
 *             #pathological case
 *             if nobs == 1:
 */
    __pyx_t_14 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
    if (__pyx_t_14) {
    } else {
      __pyx_t_13 = __pyx_t_14;
      goto __pyx_L17_bool_binop_done;
    }
    __pyx_t_14 = ((__pyx_v_nobs > __pyx_v_ddof) != 0);
    __pyx_t_13 = __pyx_t_14;
    __pyx_L17_bool_binop_done:;
    if (__pyx_t_13) {

      /* "pandas/algos.pyx":1317
 *         if (nobs >= minp) and (nobs > ddof):
 *             #pathological case
 *             if nobs == 1:             # <<<<<<<<<<<<<<
 *                 val = 0
 *             else:
 */
      __pyx_t_13 = ((__pyx_v_nobs == 1.0) != 0);
      if (__pyx_t_13) {

        /* "pandas/algos.pyx":1318
 *             #pathological case
 *             if nobs == 1:
 *                 val = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 val = ssqdm_x / (nobs - ddof)
 */
        __pyx_v_val = 0.0;
        goto __pyx_L19;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1320
 *                 val = 0
 *             else:
 *                 val = ssqdm_x / (nobs - ddof)             # <<<<<<<<<<<<<<
 *                 if val < 0:
 *                     val = 0
 */
        __pyx_t_15 = (__pyx_v_nobs - __pyx_v_ddof);
        if (unlikely(__pyx_t_15 == 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 = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_val = (__pyx_v_ssqdm_x / __pyx_t_15);

        /* "pandas/algos.pyx":1321
 *             else:
 *                 val = ssqdm_x / (nobs - ddof)
 *                 if val < 0:             # <<<<<<<<<<<<<<
 *                     val = 0
 *         else:
 */
        __pyx_t_13 = ((__pyx_v_val < 0.0) != 0);
        if (__pyx_t_13) {

          /* "pandas/algos.pyx":1322
 *                 val = ssqdm_x / (nobs - ddof)
 *                 if val < 0:
 *                     val = 0             # <<<<<<<<<<<<<<
 *         else:
 *             val = NaN
 */
          __pyx_v_val = 0.0;
          goto __pyx_L20;
        }
        __pyx_L20:;
      }
      __pyx_L19:;
      goto __pyx_L16;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1324
 *                     val = 0
 *         else:
 *             val = NaN             # <<<<<<<<<<<<<<
 * 
 *         output[i] = val
 */
      __pyx_v_val = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_L16:;

    /* "pandas/algos.pyx":1326
 *             val = NaN
 * 
 *         output[i] = val             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
    __pyx_t_19 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_19 < 0) {
      __pyx_t_19 += __pyx_pybuffernd_output.diminfo[0].shape;
      if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_19 >= __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 = 1326; __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_val;
  }

  /* "pandas/algos.pyx":1328
 *         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":1245
 * # 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);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":1334
 * # 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_37roll_skew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_37roll_skew = {"roll_skew", (PyCFunction)__pyx_pw_6pandas_5algos_37roll_skew, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_37roll_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 = 1334; __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 = 1334; __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 = 1334; __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 = 1334; __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 = 1334; __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 = 1334; __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 = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_36roll_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_36roll_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;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  long __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  double __pyx_t_19;
  double __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_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 = 1334; __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":1336
 * 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":1337
 *     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":1338
 *     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 = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":1340
 *     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 = 1340; __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 = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __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 = 1340; __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 = 1340; __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 = 1340; __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 = 1340; __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 = 1340; __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":1345
 *     cdef double A, B, C, R
 * 
 *     minp = _check_minp(win, minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_1 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_1 = 1;
    }
  }
  __pyx_t_9 = PyTuple_New(3+__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  if (__pyx_t_8) {
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
  }
  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_1, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_7 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_minp = __pyx_t_10;

  /* "pandas/algos.pyx":1347
 *     minp = _check_minp(win, minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_11 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "pandas/algos.pyx":1348
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_1 >= __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 = 1348; __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":1351
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             x += val
 */
    __pyx_t_12 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1352
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             x += val
 *             xx += val * val
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1353
 *         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":1354
 *             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":1355
 *             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":1357
 *             xxx += val * val * val
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_13 = __pyx_v_i;
    __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 = 1357; __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_v_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":1359
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_14 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_14; __pyx_v_i++) {

    /* "pandas/algos.pyx":1360
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_15 >= __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 = 1360; __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_15, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1362
 *         val = input[i]
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             x += val
 */
    __pyx_t_12 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1363
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             x += val
 *             xx += val * val
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1364
 *         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":1365
 *             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":1366
 *             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":1368
 *             xxx += val * val * val
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 *             if prev == prev:
 */
    __pyx_t_12 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1369
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 *             if prev == prev:
 *                 x -= prev
 */
      __pyx_t_16 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_10 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_input.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_16 >= __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 = 1369; __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_16, __pyx_pybuffernd_input.diminfo[0].strides));

      /* "pandas/algos.pyx":1370
 *         if i > win - 1:
 *             prev = input[i - win]
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 x -= prev
 *                 xx -= prev * prev
 */
      __pyx_t_12 = ((__pyx_v_prev == __pyx_v_prev) != 0);
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":1371
 *             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":1372
 *             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":1373
 *                 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":1375
 *                 xxx -= prev * prev * prev
 * 
 *                 nobs -= 1             # <<<<<<<<<<<<<<
 *         if nobs >= minp:
 *             A = x / nobs
 */
        __pyx_v_nobs = (__pyx_v_nobs - 1);
        goto __pyx_L10;
      }
      __pyx_L10:;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "pandas/algos.pyx":1376
 * 
 *                 nobs -= 1
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             A = x / nobs
 *             B = xx / nobs - A * A
 */
    __pyx_t_12 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1377
 *                 nobs -= 1
 *         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 = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_A = (__pyx_v_x / __pyx_v_nobs);

      /* "pandas/algos.pyx":1378
 *         if nobs >= minp:
 *             A = x / nobs
 *             B = xx / nobs - A * A             # <<<<<<<<<<<<<<
 *             C = xxx / nobs - A * A * A - 3 * A * B
 *             if B <= 0 or nobs < 3:
 */
      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 = 1378; __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":1379
 *             A = x / nobs
 *             B = xx / nobs - A * A
 *             C = xxx / nobs - A * A * A - 3 * A * B             # <<<<<<<<<<<<<<
 *             if B <= 0 or nobs < 3:
 *                 output[i] = NaN
 */
      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 = 1379; __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":1380
 *             B = xx / nobs - A * A
 *             C = xxx / nobs - A * A * A - 3 * A * B
 *             if B <= 0 or nobs < 3:             # <<<<<<<<<<<<<<
 *                 output[i] = NaN
 *             else:
 */
      __pyx_t_17 = ((__pyx_v_B <= 0.0) != 0);
      if (!__pyx_t_17) {
      } else {
        __pyx_t_12 = __pyx_t_17;
        goto __pyx_L13_bool_binop_done;
      }
      __pyx_t_17 = ((__pyx_v_nobs < 3) != 0);
      __pyx_t_12 = __pyx_t_17;
      __pyx_L13_bool_binop_done:;
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":1381
 *             C = xxx / nobs - A * A * A - 3 * A * B
 *             if B <= 0 or nobs < 3:
 *                 output[i] = NaN             # <<<<<<<<<<<<<<
 *             else:
 *                 R = sqrt(B)
 */
        __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 = 1381; __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;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1383
 *                 output[i] = NaN
 *             else:
 *                 R = sqrt(B)             # <<<<<<<<<<<<<<
 *                 output[i] = ((sqrt(nobs * (nobs - 1.)) * C) /
 *                              ((nobs-2) * R * R * R))
 */
        __pyx_v_R = sqrt(__pyx_v_B);

        /* "pandas/algos.pyx":1384
 *             else:
 *                 R = sqrt(B)
 *                 output[i] = ((sqrt(nobs * (nobs - 1.)) * C) /             # <<<<<<<<<<<<<<
 *                              ((nobs-2) * R * R * R))
 *         else:
 */
        __pyx_t_19 = (sqrt((__pyx_v_nobs * (__pyx_v_nobs - 1.))) * __pyx_v_C);

        /* "pandas/algos.pyx":1385
 *                 R = sqrt(B)
 *                 output[i] = ((sqrt(nobs * (nobs - 1.)) * C) /
 *                              ((nobs-2) * R * R * R))             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
        __pyx_t_20 = ((((__pyx_v_nobs - 2) * __pyx_v_R) * __pyx_v_R) * __pyx_v_R);

        /* "pandas/algos.pyx":1384
 *             else:
 *                 R = sqrt(B)
 *                 output[i] = ((sqrt(nobs * (nobs - 1.)) * C) /             # <<<<<<<<<<<<<<
 *                              ((nobs-2) * R * R * R))
 *         else:
 */
        if (unlikely(__pyx_t_20 == 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 = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_21 = __pyx_v_i;
        __pyx_t_10 = -1;
        if (__pyx_t_21 < 0) {
          __pyx_t_21 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_21 < 0)) __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_21 >= __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 = 1384; __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_19 / __pyx_t_20);
      }
      __pyx_L12:;
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1387
 *                              ((nobs-2) * R * R * R))
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __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 = 1387; __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_L11:;
  }

  /* "pandas/algos.pyx":1389
 *             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":1334
 * # 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);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":1395
 * 
 * 
 * def roll_kurt(ndarray[double_t] input,             # <<<<<<<<<<<<<<
 *                int win, int minp):
 *     cdef double val, prev
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_39roll_kurt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_39roll_kurt = {"roll_kurt", (PyCFunction)__pyx_pw_6pandas_5algos_39roll_kurt, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_39roll_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 = 1395; __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 = 1395; __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 = 1395; __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 = 1396; __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 = 1396; __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 = 1395; __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 = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_38roll_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_38roll_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;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  long __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  double __pyx_t_19;
  double __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_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 = 1395; __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":1398
 *                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":1399
 *     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":1400
 *     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 = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":1402
 *     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 = 1402; __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 = 1402; __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 = 1402; __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 = 1402; __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 = 1402; __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 = 1402; __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 = 1402; __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 = 1402; __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 = 1402; __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":1407
 *     cdef double A, B, C, D, R, K
 * 
 *     minp = _check_minp(win, minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_1 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_1 = 1;
    }
  }
  __pyx_t_9 = PyTuple_New(3+__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  if (__pyx_t_8) {
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
  }
  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_1, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_7 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_minp = __pyx_t_10;

  /* "pandas/algos.pyx":1409
 *     minp = _check_minp(win, minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_11 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "pandas/algos.pyx":1410
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_1 >= __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 = 1410; __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":1413
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 * 
 */
    __pyx_t_12 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1414
 *         # 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":1417
 * 
 *             # 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":1418
 *             # 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":1419
 *             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":1420
 *             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":1422
 *             xxxx += val * val * val * val
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_13 = __pyx_v_i;
    __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 = 1422; __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_v_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":1424
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_14 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_14; __pyx_v_i++) {

    /* "pandas/algos.pyx":1425
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_15 >= __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 = 1425; __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_15, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1427
 *         val = input[i]
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             x += val
 */
    __pyx_t_12 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1428
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             x += val
 *             xx += val * val
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1429
 *         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":1430
 *             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":1431
 *             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":1432
 *             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":1434
 *             xxxx += val * val * val * val
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 *             if prev == prev:
 */
    __pyx_t_12 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1435
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 *             if prev == prev:
 *                 x -= prev
 */
      __pyx_t_16 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_10 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_input.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_16 >= __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 = 1435; __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_16, __pyx_pybuffernd_input.diminfo[0].strides));

      /* "pandas/algos.pyx":1436
 *         if i > win - 1:
 *             prev = input[i - win]
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 x -= prev
 *                 xx -= prev * prev
 */
      __pyx_t_12 = ((__pyx_v_prev == __pyx_v_prev) != 0);
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":1437
 *             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":1438
 *             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":1439
 *                 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":1440
 *                 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":1442
 *                 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":1444
 *                 nobs -= 1
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             A = x / nobs
 *             R = A * A
 */
    __pyx_t_12 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1445
 * 
 *         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 = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_A = (__pyx_v_x / __pyx_v_nobs);

      /* "pandas/algos.pyx":1446
 *         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":1447
 *             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 = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_B = ((__pyx_v_xx / __pyx_v_nobs) - __pyx_v_R);

      /* "pandas/algos.pyx":1448
 *             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":1449
 *             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 = 1449; __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":1450
 *             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":1451
 *             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 = 1451; __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":1453
 *             D = xxxx / nobs - R - 6*B*A*A - 4*C*A
 * 
 *             if B == 0 or nobs < 4:             # <<<<<<<<<<<<<<
 *                 output[i] = NaN
 * 
 */
      __pyx_t_17 = ((__pyx_v_B == 0.0) != 0);
      if (!__pyx_t_17) {
      } else {
        __pyx_t_12 = __pyx_t_17;
        goto __pyx_L13_bool_binop_done;
      }
      __pyx_t_17 = ((__pyx_v_nobs < 4) != 0);
      __pyx_t_12 = __pyx_t_17;
      __pyx_L13_bool_binop_done:;
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":1454
 * 
 *             if B == 0 or nobs < 4:
 *                 output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
        __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 = 1454; __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;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1457
 * 
 *             else:
 *                 K = (nobs * nobs - 1.)*D/(B*B) - 3*((nobs-1.)**2)             # <<<<<<<<<<<<<<
 *                 K = K / ((nobs - 2.)*(nobs-3.))
 * 
 */
        __pyx_t_19 = (((__pyx_v_nobs * __pyx_v_nobs) - 1.) * __pyx_v_D);
        __pyx_t_20 = (__pyx_v_B * __pyx_v_B);
        if (unlikely(__pyx_t_20 == 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 = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_K = ((__pyx_t_19 / __pyx_t_20) - (3.0 * pow((__pyx_v_nobs - 1.), 2.0)));

        /* "pandas/algos.pyx":1458
 *             else:
 *                 K = (nobs * nobs - 1.)*D/(B*B) - 3*((nobs-1.)**2)
 *                 K = K / ((nobs - 2.)*(nobs-3.))             # <<<<<<<<<<<<<<
 * 
 *                 output[i] = K
 */
        __pyx_t_20 = ((__pyx_v_nobs - 2.) * (__pyx_v_nobs - 3.));
        if (unlikely(__pyx_t_20 == 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 = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_K = (__pyx_v_K / __pyx_t_20);

        /* "pandas/algos.pyx":1460
 *                 K = K / ((nobs - 2.)*(nobs-3.))
 * 
 *                 output[i] = K             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
        __pyx_t_21 = __pyx_v_i;
        __pyx_t_10 = -1;
        if (__pyx_t_21 < 0) {
          __pyx_t_21 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_21 < 0)) __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_21 >= __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 = 1460; __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_K;
      }
      __pyx_L12:;
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1463
 * 
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __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 = 1463; __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_L11:;
  }

  /* "pandas/algos.pyx":1465
 *             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":1395
 * 
 * 
 * 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);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":1472
 * 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;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  long __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_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":1473
 * 
 * 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 = 1473; __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":1476
 *     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":1478
 *     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 = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":1479
 * 
 *     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 = 1479; __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 = 1479; __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 = 1479; __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 = 1479; __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 = 1479; __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 = 1479; __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 = 1479; __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 = 1479; __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 = 1479; __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":1481
 *     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 = 1481; __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 = 1481; __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 = 1481; __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":1483
 *     skiplist = IndexableSkiplist(win)
 * 
 *     minp = _check_minp(win, minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_1 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_1 = 1;
    }
  }
  __pyx_t_9 = PyTuple_New(3+__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  if (__pyx_t_8) {
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
  }
  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_1, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_7 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_minp = __pyx_t_10;

  /* "pandas/algos.pyx":1485
 *     minp = _check_minp(win, minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_11 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "pandas/algos.pyx":1486
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_1 >= __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 = 1486; __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":1489
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist.insert(val)
 */
    __pyx_t_12 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1490
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist.insert(val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1491
 *         if val == val:
 *             nobs += 1
 *             skiplist.insert(val)             # <<<<<<<<<<<<<<
 * 
 *         output[i] = NaN
 */
      __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "pandas/algos.pyx":1493
 *             skiplist.insert(val)
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_13 = __pyx_v_i;
    __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 = 1493; __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_v_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":1495
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_14 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_14; __pyx_v_i++) {

    /* "pandas/algos.pyx":1496
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_15 >= __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 = 1496; __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_15, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1498
 *         val = input[i]
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 * 
 */
    __pyx_t_12 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1499
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 * 
 *             if prev == prev:
 */
      __pyx_t_16 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_10 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_input.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_16 >= __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 = 1499; __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_16, __pyx_pybuffernd_input.diminfo[0].strides));

      /* "pandas/algos.pyx":1501
 *             prev = input[i - win]
 * 
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 skiplist.remove(prev)
 *                 nobs -= 1
 */
      __pyx_t_12 = ((__pyx_v_prev == __pyx_v_prev) != 0);
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":1502
 * 
 *             if prev == prev:
 *                 skiplist.remove(prev)             # <<<<<<<<<<<<<<
 *                 nobs -= 1
 * 
 */
        __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->remove(__pyx_v_skiplist, __pyx_v_prev, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "pandas/algos.pyx":1503
 *             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":1505
 *                 nobs -= 1
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist.insert(val)
 */
    __pyx_t_12 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1506
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist.insert(val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1507
 *         if val == val:
 *             nobs += 1
 *             skiplist.insert(val)             # <<<<<<<<<<<<<<
 * 
 *         output[i] = op(skiplist, nobs, minp)
 */
      __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "pandas/algos.pyx":1509
 *             skiplist.insert(val)
 * 
 *         output[i] = op(skiplist, nobs, minp)             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
    __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 = 1509; __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_op(((PyObject *)__pyx_v_skiplist), __pyx_v_nobs, __pyx_v_minp);
  }

  /* "pandas/algos.pyx":1511
 *         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":1472
 * 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);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":1515
 * 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_41roll_median_c(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_41roll_median_c = {"roll_median_c", (PyCFunction)__pyx_pw_6pandas_5algos_41roll_median_c, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_41roll_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 = 1515; __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 = 1515; __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 = 1515; __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 = 1515; __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 = 1515; __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 = 1515; __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 = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_40roll_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_40roll_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;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  long __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("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 = 1515; __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":1518
 *     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":1520
 *         int ret=0
 *         skiplist_t *sl
 *         Py_ssize_t midpoint, nobs = 0, i             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_nobs = 0;

  /* "pandas/algos.pyx":1523
 * 
 * 
 *     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 = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":1524
 * 
 *     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 = 1524; __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 = 1524; __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 = 1524; __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 = 1524; __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 = 1524; __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 = 1524; __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 = 1524; __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 = 1524; __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 = 1524; __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":1526
 *     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":1528
 *     sl = skiplist_init(win)
 * 
 *     minp = _check_minp(win, minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_1 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_1 = 1;
    }
  }
  __pyx_t_9 = PyTuple_New(3+__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  if (__pyx_t_8) {
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
  }
  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_1, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_7 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_minp = __pyx_t_10;

  /* "pandas/algos.pyx":1530
 *     minp = _check_minp(win, minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = arg[i]
 * 
 */
  __pyx_t_11 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "pandas/algos.pyx":1531
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = arg[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_pybuffernd_arg.diminfo[0].shape;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_arg.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 = 1531; __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":1534
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist_insert(sl, val)
 */
    __pyx_t_12 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1535
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist_insert(sl, val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1536
 *         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":1538
 *             skiplist_insert(sl, val)
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_13 = __pyx_v_i;
    __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 = 1538; __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_v_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":1540
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = arg[i]
 * 
 */
  __pyx_t_14 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_14; __pyx_v_i++) {

    /* "pandas/algos.pyx":1541
 * 
 *     for i from minp - 1 <= i < N:
 *         val = arg[i]             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_arg.diminfo[0].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_arg.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 = 1541; __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_15, __pyx_pybuffernd_arg.diminfo[0].strides));

    /* "pandas/algos.pyx":1543
 *         val = arg[i]
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = arg[i - win]
 * 
 */
    __pyx_t_12 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1544
 * 
 *         if i > win - 1:
 *             prev = arg[i - win]             # <<<<<<<<<<<<<<
 * 
 *             if prev == prev:
 */
      __pyx_t_16 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_10 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_arg.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_arg.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 = 1544; __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_16, __pyx_pybuffernd_arg.diminfo[0].strides));

      /* "pandas/algos.pyx":1546
 *             prev = arg[i - win]
 * 
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 skiplist_remove(sl, prev)
 *                 nobs -= 1
 */
      __pyx_t_12 = ((__pyx_v_prev == __pyx_v_prev) != 0);
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":1547
 * 
 *             if prev == prev:
 *                 skiplist_remove(sl, prev)             # <<<<<<<<<<<<<<
 *                 nobs -= 1
 * 
 */
        skiplist_remove(__pyx_v_sl, __pyx_v_prev);

        /* "pandas/algos.pyx":1548
 *             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":1550
 *                 nobs -= 1
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist_insert(sl, val)
 */
    __pyx_t_12 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1551
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist_insert(sl, val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1552
 *         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":1554
 *             skiplist_insert(sl, val)
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             midpoint = nobs / 2
 *             if nobs % 2:
 */
    __pyx_t_12 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1555
 * 
 *         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":1556
 *         if nobs >= minp:
 *             midpoint = nobs / 2
 *             if nobs % 2:             # <<<<<<<<<<<<<<
 *                 res = skiplist_get(sl, midpoint, &ret)
 *             else:
 */
      __pyx_t_12 = (__Pyx_mod_Py_ssize_t(__pyx_v_nobs, 2) != 0);
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":1557
 *             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":1560
 *             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":1562
 *                        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":1564
 *             res = NaN
 * 
 *         output[i] = res             # <<<<<<<<<<<<<<
 * 
 *     skiplist_destroy(sl)
 */
    __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 = 1564; __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_res;
  }

  /* "pandas/algos.pyx":1566
 *         output[i] = res
 * 
 *     skiplist_destroy(sl)             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
  skiplist_destroy(__pyx_v_sl);

  /* "pandas/algos.pyx":1568
 *     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":1515
 * 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);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":1570
 *     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_43roll_median_cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_42roll_median_cython[] = "\n    O(N log(window)) implementation using skip list\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_43roll_median_cython = {"roll_median_cython", (PyCFunction)__pyx_pw_6pandas_5algos_43roll_median_cython, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_42roll_median_cython};
static PyObject *__pyx_pw_6pandas_5algos_43roll_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 = 1570; __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 = 1570; __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 = 1570; __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 = 1570; __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 = 1570; __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 = 1570; __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 = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_42roll_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_42roll_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":1574
 *     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 = 1574; __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":1570
 *     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":1579
 * # 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":1581
 * 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":1582
 *     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":1583
 *     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":1584
 *     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":1585
 *         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 = 1585; __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 = 1585; __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":1587
 *             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 = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);

      /* "pandas/algos.pyx":1588
 *         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 = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);

      /* "pandas/algos.pyx":1587
 *             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 = 1587; __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":1588
 *         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 = 1588; __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 = 1588; __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":1590
 *                     skiplist.get(midpoint - 1)) / 2
 *     else:
 *         return NaN             # <<<<<<<<<<<<<<
 * 
 * #----------------------------------------------------------------------
 */
    __pyx_r = __pyx_v_6pandas_5algos_NaN;
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":1579
 * # 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":1606
 * @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_45roll_max2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_44roll_max2[] = "Moving max of 1d array of dtype=float64 along axis=0 ignoring NaNs.";
static PyMethodDef __pyx_mdef_6pandas_5algos_45roll_max2 = {"roll_max2", (PyCFunction)__pyx_pw_6pandas_5algos_45roll_max2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_44roll_max2};
static PyObject *__pyx_pw_6pandas_5algos_45roll_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 = 1606; __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 = 1606; __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 = 1606; __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 = 1606; __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 = 1606; __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 = 1606; __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 = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_44roll_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_44roll_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;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __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;
  double __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  long __pyx_t_20;
  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 = 1606; __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":1616
 *     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":1617
 *     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":1618
 *     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":1619
 *     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 = 1619; __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 = 1619; __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 = 1619; __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":1622
 * 		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":1624
 *     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 = 1624; __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 = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/algos.pyx":1623
 * 
 *     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 = 1623; __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 = 1623; __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 = 1623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/algos.pyx":1626
 *                          % (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":1628
 *     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 = 1628; __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 = 1628; __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 = 1628; __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 = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pandas/algos.pyx":1627
 * 
 *     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 = 1627; __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 = 1627; __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 = 1627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/algos.pyx":1630
 *                         % (minp, window))
 * 
 *     minp = _check_minp(window, minp, n0)             # <<<<<<<<<<<<<<
 * 
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_n0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = NULL;
  __pyx_t_10 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_10 = 1;
    }
  }
  __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  if (__pyx_t_9) {
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
  }
  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_minp = __pyx_t_12;

  /* "pandas/algos.pyx":1632
 *     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":1633
 * 
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 *     end = ring + window             # <<<<<<<<<<<<<<
 *     last = ring
 * 
 */
  __pyx_v_end = (__pyx_v_ring + __pyx_v_window);

  /* "pandas/algos.pyx":1634
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 *     end = ring + window
 *     last = ring             # <<<<<<<<<<<<<<
 * 
 *     minpair = ring
 */
  __pyx_v_last = __pyx_v_ring;

  /* "pandas/algos.pyx":1636
 *     last = ring
 * 
 *     minpair = ring             # <<<<<<<<<<<<<<
 *     ai = a[0]
 *     if ai == ai:
 */
  __pyx_v_minpair = __pyx_v_ring;

  /* "pandas/algos.pyx":1637
 * 
 *     minpair = ring
 *     ai = a[0]             # <<<<<<<<<<<<<<
 *     if ai == ai:
 *         minpair.value = ai
 */
  __pyx_t_13 = 0;
  __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":1638
 *     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":1639
 *     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":1641
 *         minpair.value = ai
 *     else:
 *         minpair.value = MINfloat64             # <<<<<<<<<<<<<<
 *     minpair.death = window
 * 
 */
    __pyx_v_minpair->value = __pyx_v_6pandas_5algos_MINfloat64;
  }
  __pyx_L5:;

  /* "pandas/algos.pyx":1642
 *     else:
 *         minpair.value = MINfloat64
 *     minpair.death = window             # <<<<<<<<<<<<<<
 * 
 *     count = 0
 */
  __pyx_v_minpair->death = __pyx_v_window;

  /* "pandas/algos.pyx":1644
 *     minpair.death = window
 * 
 *     count = 0             # <<<<<<<<<<<<<<
 *     for i0 in range(n0):
 *         ai = a[i0]
 */
  __pyx_v_count = 0;

  /* "pandas/algos.pyx":1645
 * 
 *     count = 0
 *     for i0 in range(n0):             # <<<<<<<<<<<<<<
 *         ai = a[i0]
 *         if ai == ai:
 */
  __pyx_t_10 = __pyx_v_n0;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_10; __pyx_t_14+=1) {
    __pyx_v_i0 = __pyx_t_14;

    /* "pandas/algos.pyx":1646
 *     count = 0
 *     for i0 in range(n0):
 *         ai = a[i0]             # <<<<<<<<<<<<<<
 *         if ai == ai:
 *             count += 1
 */
    __pyx_t_15 = __pyx_v_i0;
    __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_a.diminfo[0].strides));

    /* "pandas/algos.pyx":1647
 *     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":1648
 *         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":1650
 *             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":1651
 *         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":1652
 *             ai = MINfloat64
 *         if i0 >= window:
 *             aold = a[i0 - window]             # <<<<<<<<<<<<<<
 *             if aold == aold:
 *                 count -= 1
 */
      __pyx_t_16 = (__pyx_v_i0 - __pyx_v_window);
      __pyx_v_aold = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a.diminfo[0].strides));

      /* "pandas/algos.pyx":1653
 *         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":1654
 *             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":1655
 *             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":1656
 *                 count -= 1
 *         if minpair.death == i0:
 *             minpair += 1             # <<<<<<<<<<<<<<
 *             if minpair >= end:
 *                 minpair = ring
 */
      __pyx_v_minpair = (__pyx_v_minpair + 1);

      /* "pandas/algos.pyx":1657
 *         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":1658
 *             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":1659
 *             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":1660
 *                 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":1661
 *         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":1662
 *             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":1664
 *             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":1665
 *         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":1666
 *             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":1667
 *                 if last == ring:
 *                     last = end
 *                 last -= 1             # <<<<<<<<<<<<<<
 *             last += 1
 *             if last == end:
 */
        __pyx_v_last = (__pyx_v_last - 1);
      }

      /* "pandas/algos.pyx":1668
 *                     last = end
 *                 last -= 1
 *             last += 1             # <<<<<<<<<<<<<<
 *             if last == end:
 *                 last = ring
 */
      __pyx_v_last = (__pyx_v_last + 1);

      /* "pandas/algos.pyx":1669
 *                 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":1670
 *             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":1671
 *             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":1672
 *                 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":1673
 *             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":1674
 *             last.death = i0 + window
 *         if count >= minp:
 *             y[i0] = minpair.value             # <<<<<<<<<<<<<<
 *         else:
 *             y[i0] = NaN
 */
      __pyx_t_17 = __pyx_v_minpair->value;
      __pyx_t_18 = __pyx_v_i0;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_t_17;
      goto __pyx_L18;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1676
 *             y[i0] = minpair.value
 *         else:
 *             y[i0] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i0 in range(minp - 1):
 */
      __pyx_t_19 = __pyx_v_i0;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_L18:;
  }

  /* "pandas/algos.pyx":1678
 *             y[i0] = NaN
 * 
 *     for i0 in range(minp - 1):             # <<<<<<<<<<<<<<
 *         y[i0] = NaN
 * 
 */
  __pyx_t_20 = (__pyx_v_minp - 1);
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_20; __pyx_t_10+=1) {
    __pyx_v_i0 = __pyx_t_10;

    /* "pandas/algos.pyx":1679
 * 
 *     for i0 in range(minp - 1):
 *         y[i0] = NaN             # <<<<<<<<<<<<<<
 * 
 *     stdlib.free(ring)
 */
    __pyx_t_14 = __pyx_v_i0;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":1681
 *         y[i0] = NaN
 * 
 *     stdlib.free(ring)             # <<<<<<<<<<<<<<
 *     return y
 * 
 */
  free(__pyx_v_ring);

  /* "pandas/algos.pyx":1682
 * 
 *     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":1606
 * @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);
  __Pyx_XDECREF(__pyx_t_9);
  __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_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":1684
 *     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_47roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_46roll_max[] = "\n    O(N log(window)) implementation using skip list\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_47roll_max = {"roll_max", (PyCFunction)__pyx_pw_6pandas_5algos_47roll_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_46roll_max};
static PyObject *__pyx_pw_6pandas_5algos_47roll_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 = 1684; __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 = 1684; __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 = 1684; __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 = 1684; __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 = 1684; __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 = 1684; __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 = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_46roll_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_46roll_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":1688
 *     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 = 1688; __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":1684
 *     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":1691
 * 
 * 
 * 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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_5numpy_double_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_max", 0);

  /* "pandas/algos.pyx":1692
 * 
 * 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":1693
 * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_skiplist, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_nobs - 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __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); __pyx_t_5 = NULL;
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __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_3); __pyx_t_3 = 0;
    __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_7;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/algos.pyx":1695
 *         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":1691
 * 
 * 
 * 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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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":1697
 *         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_49roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_48roll_min[] = "\n    O(N log(window)) implementation using skip list\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_49roll_min = {"roll_min", (PyCFunction)__pyx_pw_6pandas_5algos_49roll_min, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_48roll_min};
static PyObject *__pyx_pw_6pandas_5algos_49roll_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 = 1697; __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 = 1697; __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 = 1697; __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 = 1697; __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 = 1697; __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 = 1697; __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 = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_48roll_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_48roll_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":1701
 *     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 = 1701; __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":1697
 *         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":1705
 * @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_51roll_min2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_50roll_min2[] = "Moving min of 1d array of dtype=float64 along axis=0 ignoring NaNs.";
static PyMethodDef __pyx_mdef_6pandas_5algos_51roll_min2 = {"roll_min2", (PyCFunction)__pyx_pw_6pandas_5algos_51roll_min2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_50roll_min2};
static PyObject *__pyx_pw_6pandas_5algos_51roll_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 = 1705; __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 = 1705; __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 = 1705; __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 = 1705; __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 = 1705; __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 = 1705; __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 = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_50roll_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_50roll_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;
  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;
  int __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;
  double __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  long __pyx_t_20;
  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 = 1705; __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":1715
 *     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":1716
 *     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":1717
 *     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":1718
 *     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 = 1718; __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 = 1718; __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 = 1718; __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":1721
 * 		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":1723
 *     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 = 1723; __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 = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/algos.pyx":1722
 * 
 *     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 = 1722; __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 = 1722; __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 = 1722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/algos.pyx":1725
 *                          % (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":1727
 *     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 = 1727; __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 = 1727; __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 = 1727; __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 = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pandas/algos.pyx":1726
 * 
 *     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 = 1726; __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 = 1726; __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 = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/algos.pyx":1729
 *                         % (minp, window))
 * 
 *     minp = _check_minp(window, minp, n0)             # <<<<<<<<<<<<<<
 * 
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_n0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = NULL;
  __pyx_t_10 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_10 = 1;
    }
  }
  __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  if (__pyx_t_9) {
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
  }
  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_minp = __pyx_t_12;

  /* "pandas/algos.pyx":1731
 *     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":1732
 * 
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 *     end = ring + window             # <<<<<<<<<<<<<<
 *     last = ring
 * 
 */
  __pyx_v_end = (__pyx_v_ring + __pyx_v_window);

  /* "pandas/algos.pyx":1733
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 *     end = ring + window
 *     last = ring             # <<<<<<<<<<<<<<
 * 
 *     minpair = ring
 */
  __pyx_v_last = __pyx_v_ring;

  /* "pandas/algos.pyx":1735
 *     last = ring
 * 
 *     minpair = ring             # <<<<<<<<<<<<<<
 *     ai = a[0]
 *     if ai == ai:
 */
  __pyx_v_minpair = __pyx_v_ring;

  /* "pandas/algos.pyx":1736
 * 
 *     minpair = ring
 *     ai = a[0]             # <<<<<<<<<<<<<<
 *     if ai == ai:
 *         minpair.value = ai
 */
  __pyx_t_13 = 0;
  __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":1737
 *     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":1738
 *     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":1740
 *         minpair.value = ai
 *     else:
 *         minpair.value = MAXfloat64             # <<<<<<<<<<<<<<
 *     minpair.death = window
 * 
 */
    __pyx_v_minpair->value = __pyx_v_6pandas_5algos_MAXfloat64;
  }
  __pyx_L5:;

  /* "pandas/algos.pyx":1741
 *     else:
 *         minpair.value = MAXfloat64
 *     minpair.death = window             # <<<<<<<<<<<<<<
 * 
 *     count = 0
 */
  __pyx_v_minpair->death = __pyx_v_window;

  /* "pandas/algos.pyx":1743
 *     minpair.death = window
 * 
 *     count = 0             # <<<<<<<<<<<<<<
 *     for i0 in range(n0):
 *         ai = a[i0]
 */
  __pyx_v_count = 0;

  /* "pandas/algos.pyx":1744
 * 
 *     count = 0
 *     for i0 in range(n0):             # <<<<<<<<<<<<<<
 *         ai = a[i0]
 *         if ai == ai:
 */
  __pyx_t_10 = __pyx_v_n0;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_10; __pyx_t_14+=1) {
    __pyx_v_i0 = __pyx_t_14;

    /* "pandas/algos.pyx":1745
 *     count = 0
 *     for i0 in range(n0):
 *         ai = a[i0]             # <<<<<<<<<<<<<<
 *         if ai == ai:
 *             count += 1
 */
    __pyx_t_15 = __pyx_v_i0;
    __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_a.diminfo[0].strides));

    /* "pandas/algos.pyx":1746
 *     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":1747
 *         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":1749
 *             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":1750
 *         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":1751
 *             ai = MAXfloat64
 *         if i0 >= window:
 *             aold = a[i0 - window]             # <<<<<<<<<<<<<<
 *             if aold == aold:
 *                 count -= 1
 */
      __pyx_t_16 = (__pyx_v_i0 - __pyx_v_window);
      __pyx_v_aold = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a.diminfo[0].strides));

      /* "pandas/algos.pyx":1752
 *         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":1753
 *             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":1754
 *             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":1755
 *                 count -= 1
 *         if minpair.death == i0:
 *             minpair += 1             # <<<<<<<<<<<<<<
 *             if minpair >= end:
 *                 minpair = ring
 */
      __pyx_v_minpair = (__pyx_v_minpair + 1);

      /* "pandas/algos.pyx":1756
 *         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":1757
 *             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":1758
 *             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":1759
 *                 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":1760
 *         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":1761
 *             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":1763
 *             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":1764
 *         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":1765
 *             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":1766
 *                 if last == ring:
 *                     last = end
 *                 last -= 1             # <<<<<<<<<<<<<<
 *             last += 1
 *             if last == end:
 */
        __pyx_v_last = (__pyx_v_last - 1);
      }

      /* "pandas/algos.pyx":1767
 *                     last = end
 *                 last -= 1
 *             last += 1             # <<<<<<<<<<<<<<
 *             if last == end:
 *                 last = ring
 */
      __pyx_v_last = (__pyx_v_last + 1);

      /* "pandas/algos.pyx":1768
 *                 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":1769
 *             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":1770
 *             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":1771
 *                 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":1772
 *             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":1773
 *             last.death = i0 + window
 *         if count >= minp:
 *             y[i0] = minpair.value             # <<<<<<<<<<<<<<
 *         else:
 *             y[i0] = NaN
 */
      __pyx_t_17 = __pyx_v_minpair->value;
      __pyx_t_18 = __pyx_v_i0;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_t_17;
      goto __pyx_L18;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1775
 *             y[i0] = minpair.value
 *         else:
 *             y[i0] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i0 in range(minp - 1):
 */
      __pyx_t_19 = __pyx_v_i0;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
    }
    __pyx_L18:;
  }

  /* "pandas/algos.pyx":1777
 *             y[i0] = NaN
 * 
 *     for i0 in range(minp - 1):             # <<<<<<<<<<<<<<
 *         y[i0] = NaN
 * 
 */
  __pyx_t_20 = (__pyx_v_minp - 1);
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_20; __pyx_t_10+=1) {
    __pyx_v_i0 = __pyx_t_10;

    /* "pandas/algos.pyx":1778
 * 
 *     for i0 in range(minp - 1):
 *         y[i0] = NaN             # <<<<<<<<<<<<<<
 * 
 *     stdlib.free(ring)
 */
    __pyx_t_14 = __pyx_v_i0;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":1780
 *         y[i0] = NaN
 * 
 *     stdlib.free(ring)             # <<<<<<<<<<<<<<
 *     return y
 * 
 */
  free(__pyx_v_ring);

  /* "pandas/algos.pyx":1781
 * 
 *     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":1705
 * @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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __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":1783
 *     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":1784
 * 
 * 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":1785
 * 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 = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __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 = 1785; __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":1787
 *         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":1783
 *     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":1789
 *         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_53roll_quantile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_52roll_quantile[] = "\n    O(N log(window)) implementation using skip list\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_53roll_quantile = {"roll_quantile", (PyCFunction)__pyx_pw_6pandas_5algos_53roll_quantile, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_52roll_quantile};
static PyObject *__pyx_pw_6pandas_5algos_53roll_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 = 1789; __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 = 1789; __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 = 1789; __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 = 1789; __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 = 1789; __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 = 1790; __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 = 1790; __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 = 1789; __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 = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_52roll_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_52roll_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;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  long __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  __pyx_t_5numpy_double_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("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 = 1789; __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":1796
 *     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":1797
 *     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 = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/algos.pyx":1798
 *     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 = 1798; __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 = 1798; __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 = 1798; __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 = 1798; __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 = 1798; __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 = 1798; __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 = 1798; __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 = 1798; __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 = 1798; __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":1800
 *     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 = 1800; __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 = 1800; __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 = 1800; __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":1802
 *     skiplist = IndexableSkiplist(win)
 * 
 *     minp = _check_minp(win, minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_1 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_1 = 1;
    }
  }
  __pyx_t_9 = PyTuple_New(3+__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  if (__pyx_t_8) {
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
  }
  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_1, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_7 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_minp = __pyx_t_10;

  /* "pandas/algos.pyx":1804
 *     minp = _check_minp(win, minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_11 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "pandas/algos.pyx":1805
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_1 >= __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 = 1805; __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":1808
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist.insert(val)
 */
    __pyx_t_12 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1809
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist.insert(val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1810
 *         if val == val:
 *             nobs += 1
 *             skiplist.insert(val)             # <<<<<<<<<<<<<<
 * 
 *         output[i] = NaN
 */
      __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); 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_5); __pyx_t_5 = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "pandas/algos.pyx":1812
 *             skiplist.insert(val)
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_13 = __pyx_v_i;
    __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 = 1812; __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_v_6pandas_5algos_NaN;
  }

  /* "pandas/algos.pyx":1814
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_14 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_14; __pyx_v_i++) {

    /* "pandas/algos.pyx":1815
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_input.diminfo[0].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_15 >= __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 = 1815; __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_15, __pyx_pybuffernd_input.diminfo[0].strides));

    /* "pandas/algos.pyx":1817
 *         val = input[i]
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 * 
 */
    __pyx_t_12 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1818
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 * 
 *             if prev == prev:
 */
      __pyx_t_16 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_10 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_input.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_16 >= __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 = 1818; __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_16, __pyx_pybuffernd_input.diminfo[0].strides));

      /* "pandas/algos.pyx":1820
 *             prev = input[i - win]
 * 
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 skiplist.remove(prev)
 *                 nobs -= 1
 */
      __pyx_t_12 = ((__pyx_v_prev == __pyx_v_prev) != 0);
      if (__pyx_t_12) {

        /* "pandas/algos.pyx":1821
 * 
 *             if prev == prev:
 *                 skiplist.remove(prev)             # <<<<<<<<<<<<<<
 *                 nobs -= 1
 * 
 */
        __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->remove(__pyx_v_skiplist, __pyx_v_prev, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "pandas/algos.pyx":1822
 *             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":1824
 *                 nobs -= 1
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist.insert(val)
 */
    __pyx_t_12 = ((__pyx_v_val == __pyx_v_val) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1825
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist.insert(val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "pandas/algos.pyx":1826
 *         if val == val:
 *             nobs += 1
 *             skiplist.insert(val)             # <<<<<<<<<<<<<<
 * 
 *         if nobs >= minp:
 */
      __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "pandas/algos.pyx":1828
 *             skiplist.insert(val)
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             idx = int((quantile / 1.) * (nobs - 1))
 *             output[i] = skiplist.get(idx)
 */
    __pyx_t_12 = ((__pyx_v_nobs >= __pyx_v_minp) != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":1829
 * 
 *         if nobs >= minp:
 *             idx = int((quantile / 1.) * (nobs - 1))             # <<<<<<<<<<<<<<
 *             output[i] = skiplist.get(idx)
 *         else:
 */
      __pyx_t_5 = PyFloat_FromDouble(((__pyx_v_quantile / 1.) * (__pyx_v_nobs - 1))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1829; __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 = 1829; __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*)(&PyInt_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "pandas/algos.pyx":1830
 *         if nobs >= minp:
 *             idx = int((quantile / 1.) * (nobs - 1))
 *             output[i] = skiplist.get(idx)             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
      __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->get(__pyx_v_skiplist, __pyx_t_17, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_18 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __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 = 1830; __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_18;
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1832
 *             output[i] = skiplist.get(idx)
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_19 >= __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 = 1832; __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;
    }
    __pyx_L11:;
  }

  /* "pandas/algos.pyx":1834
 *             output[i] = NaN
 * 
 *     return output             # <<<<<<<<<<<<<<
 * 
 * def roll_generic(ndarray[float64_t, cast=True] input,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  /* "pandas/algos.pyx":1789
 *         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);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":1836
 *     return output
 * 
 * def roll_generic(ndarray[float64_t, cast=True] input,             # <<<<<<<<<<<<<<
 *                  int win, int minp, int offset,
 *                  object func, object args, object kwargs):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_55roll_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_55roll_generic = {"roll_generic", (PyCFunction)__pyx_pw_6pandas_5algos_55roll_generic, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_55roll_generic(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_offset;
  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_offset,&__pyx_n_s_func,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[7] = {0,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  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        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, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __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, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  6:
        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __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 = 1836; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      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);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __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 = 1837; __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 = 1837; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_offset = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_func = values[4];
    __pyx_v_args = values[5];
    __pyx_v_kwargs = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __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 = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_54roll_generic(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_offset, __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_54roll_generic(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, int __pyx_v_offset, 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;
  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;
  int __pyx_t_20;
  __pyx_t_5numpy_double_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_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 = 1836; __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":1844
 *     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 = 1844; __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 = 1844; __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 = 1844; __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":1845
 * 
 *     if not input.flags.c_contiguous:
 *         input = input.copy('C')             # <<<<<<<<<<<<<<
 * 
 *     n = len(input)
 */
    __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 = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1845; __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 = 1845; __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 = 1845; __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":1847
 *         input = input.copy('C')
 * 
 *     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 = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_10;

  /* "pandas/algos.pyx":1848
 * 
 *     n = len(input)
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return input
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (__pyx_t_4) {

    /* "pandas/algos.pyx":1849
 *     n = len(input)
 *     if n == 0:
 *         return input             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(win, minp, n, floor=0)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_input));
    __pyx_r = ((PyObject *)__pyx_v_input);
    goto __pyx_L0;
  }

  /* "pandas/algos.pyx":1851
 *         return input
 * 
 *     minp = _check_minp(win, minp, n, floor=0)             # <<<<<<<<<<<<<<
 *     output = np.empty(n, dtype=float)
 *     counts = roll_sum(np.concatenate((np.isfinite(input).astype(float), np.array([0.] * offset))), win, minp)[offset:]
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __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 = 1851; __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 = 1851; __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 = 1851; __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 = 1851; __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 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_floor, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __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_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_v_minp = __pyx_t_6;

  /* "pandas/algos.pyx":1852
 * 
 *     minp = _check_minp(win, minp, n, floor=0)
 *     output = np.empty(n, dtype=float)             # <<<<<<<<<<<<<<
 *     counts = roll_sum(np.concatenate((np.isfinite(input).astype(float), np.array([0.] * offset))), win, minp)[offset:]
 * 
 */
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_empty); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  PyTuple_SET_ITEM(__pyx_t_13, 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 = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __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_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 = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_1);
  {
    __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 = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/algos.pyx":1853
 *     minp = _check_minp(win, minp, n, floor=0)
 *     output = np.empty(n, dtype=float)
 *     counts = roll_sum(np.concatenate((np.isfinite(input).astype(float), np.array([0.] * offset))), win, minp)[offset:]             # <<<<<<<<<<<<<<
 * 
 *     # truncated windows at the beginning, through first full-length window
 */
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_roll_sum); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __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 = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_isfinite); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_16 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_17))) {
    __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17);
    if (likely(__pyx_t_16)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
      __Pyx_INCREF(__pyx_t_16);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_17, function);
    }
  }
  if (!__pyx_t_16) {
    __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_t_17, ((PyObject *)__pyx_v_input)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
  } else {
    __pyx_t_18 = PyTuple_New(1+1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_18);
    PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_input));
    PyTuple_SET_ITEM(__pyx_t_18, 0+1, ((PyObject *)__pyx_v_input));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_input));
    __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_18, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  }
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_astype); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_15 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_17))) {
    __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_17);
    if (likely(__pyx_t_15)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
      __Pyx_INCREF(__pyx_t_15);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_17, function);
    }
  }
  if (!__pyx_t_15) {
    __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_17, ((PyObject *)((PyObject*)(&PyFloat_Type)))); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
  } else {
    __pyx_t_18 = PyTuple_New(1+1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_18);
    PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = NULL;
    __Pyx_INCREF(((PyObject *)((PyObject*)(&PyFloat_Type))));
    PyTuple_SET_ITEM(__pyx_t_18, 0+1, ((PyObject *)((PyObject*)(&PyFloat_Type))));
    __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyFloat_Type))));
    __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_18, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  }
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_array); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_18 = PyList_New(1 * ((__pyx_v_offset<0) ? 0:__pyx_v_offset)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_18);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_offset; __pyx_temp++) {
      __Pyx_INCREF(__pyx_float_0_);
      PyList_SET_ITEM(__pyx_t_18, __pyx_temp, __pyx_float_0_);
      __Pyx_GIVEREF(__pyx_float_0_);
    }
  }
  __pyx_t_16 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
    __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15);
    if (likely(__pyx_t_16)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
      __Pyx_INCREF(__pyx_t_16);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_15, function);
    }
  }
  if (!__pyx_t_16) {
    __pyx_t_17 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_18); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    __Pyx_GOTREF(__pyx_t_17);
  } else {
    __pyx_t_19 = PyTuple_New(1+1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
    PyTuple_SET_ITEM(__pyx_t_19, 0+1, __pyx_t_18);
    __Pyx_GIVEREF(__pyx_t_18);
    __pyx_t_18 = 0;
    __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_19, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 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 = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_17);
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_12 = 0;
  __pyx_t_17 = 0;
  __pyx_t_17 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_17)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_17);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_17) {
    __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_15); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_GOTREF(__pyx_t_13);
  } else {
    __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = NULL;
    PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_15);
    __Pyx_GIVEREF(__pyx_t_15);
    __pyx_t_15 = 0;
    __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_15 = NULL;
  __pyx_t_10 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
    __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_11);
    if (likely(__pyx_t_15)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_15);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_11, function);
      __pyx_t_10 = 1;
    }
  }
  __pyx_t_17 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (__pyx_t_15) {
    PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = NULL;
  }
  PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_10, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_13);
  PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_10, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_17, 2+__pyx_t_10, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_13 = 0;
  __pyx_t_2 = 0;
  __pyx_t_12 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_17, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_t_1, __pyx_v_offset, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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 = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_11);
  {
    __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 = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "pandas/algos.pyx":1856
 * 
 *     # truncated windows at the beginning, through first full-length window
 *     for i from 0 <= i < (int_min(win, n) - offset):             # <<<<<<<<<<<<<<
 *         if counts[i] >= minp:
 *             output[i] = func(input[0 : (i + offset + 1)], *args, **kwargs)
 */
  __pyx_t_6 = (__pyx_f_6pandas_5algos_int_min(__pyx_v_win, __pyx_v_n) - __pyx_v_offset);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {

    /* "pandas/algos.pyx":1857
 *     # truncated windows at the beginning, through first full-length window
 *     for i from 0 <= i < (int_min(win, n) - offset):
 *         if counts[i] >= minp:             # <<<<<<<<<<<<<<
 *             output[i] = func(input[0 : (i + offset + 1)], *args, **kwargs)
 *         else:
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_20 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_pybuffernd_counts.diminfo[0].shape;
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_20 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_20 = 0;
    if (unlikely(__pyx_t_20 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_20);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; __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":1858
 *     for i from 0 <= i < (int_min(win, n) - offset):
 *         if counts[i] >= minp:
 *             output[i] = func(input[0 : (i + offset + 1)], *args, **kwargs)             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
      __pyx_t_11 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_input), 0, ((__pyx_v_i + __pyx_v_offset) + 1), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __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 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_17 = PyNumber_Add(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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 = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      if (likely(PyDict_Check(__pyx_v_kwargs))) {
        __pyx_t_11 = __pyx_v_kwargs;
        __Pyx_INCREF(__pyx_t_11);
      } else {
        __pyx_t_11 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kwargs, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
      }
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_17, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_21 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_22 = __pyx_v_i;
      __pyx_t_20 = -1;
      if (__pyx_t_22 < 0) {
        __pyx_t_22 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_22 < 0)) __pyx_t_20 = 0;
      } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_20 = 0;
      if (unlikely(__pyx_t_20 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_20);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __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_21;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1860
 *             output[i] = func(input[0 : (i + offset + 1)], *args, **kwargs)
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     # remaining full-length windows
 */
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_20 = -1;
      if (__pyx_t_23 < 0) {
        __pyx_t_23 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_23 < 0)) __pyx_t_20 = 0;
      } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_20 = 0;
      if (unlikely(__pyx_t_20 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_20);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __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_v_6pandas_5algos_NaN;
    }
    __pyx_L7:;
  }

  /* "pandas/algos.pyx":1863
 * 
 *     # remaining full-length windows
 *     buf = <float64_t*> input.data             # <<<<<<<<<<<<<<
 *     bufarr = np.empty(win, dtype=float)
 *     oldbuf = <float64_t*> bufarr.data
 */
  __pyx_v_buf = ((__pyx_t_5numpy_float64_t *)__pyx_v_input->data);

  /* "pandas/algos.pyx":1864
 *     # remaining full-length windows
 *     buf = <float64_t*> input.data
 *     bufarr = np.empty(win, dtype=float)             # <<<<<<<<<<<<<<
 *     oldbuf = <float64_t*> bufarr.data
 *     for i from (win - offset) <= i < (n - offset):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  PyTuple_SET_ITEM(__pyx_t_17, 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 = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_17, __pyx_t_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __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_17); __pyx_t_17 = 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 = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_12);
  {
    __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 = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_bufarr = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/algos.pyx":1865
 *     buf = <float64_t*> input.data
 *     bufarr = np.empty(win, dtype=float)
 *     oldbuf = <float64_t*> bufarr.data             # <<<<<<<<<<<<<<
 *     for i from (win - offset) <= i < (n - offset):
 *         buf = buf + 1
 */
  __pyx_v_oldbuf = ((__pyx_t_5numpy_float64_t *)__pyx_v_bufarr->data);

  /* "pandas/algos.pyx":1866
 *     bufarr = np.empty(win, dtype=float)
 *     oldbuf = <float64_t*> bufarr.data
 *     for i from (win - offset) <= i < (n - offset):             # <<<<<<<<<<<<<<
 *         buf = buf + 1
 *         bufarr.data = <char*> buf
 */
  __pyx_t_24 = (__pyx_v_n - __pyx_v_offset);
  for (__pyx_v_i = (__pyx_v_win - __pyx_v_offset); __pyx_v_i < __pyx_t_24; __pyx_v_i++) {

    /* "pandas/algos.pyx":1867
 *     oldbuf = <float64_t*> bufarr.data
 *     for i from (win - offset) <= i < (n - offset):
 *         buf = buf + 1             # <<<<<<<<<<<<<<
 *         bufarr.data = <char*> buf
 *         if counts[i] >= minp:
 */
    __pyx_v_buf = (__pyx_v_buf + 1);

    /* "pandas/algos.pyx":1868
 *     for i from (win - offset) <= i < (n - offset):
 *         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":1869
 *         buf = buf + 1
 *         bufarr.data = <char*> buf
 *         if counts[i] >= minp:             # <<<<<<<<<<<<<<
 *             output[i] = func(bufarr, *args, **kwargs)
 *         else:
 */
    __pyx_t_25 = __pyx_v_i;
    __pyx_t_6 = -1;
    if (__pyx_t_25 < 0) {
      __pyx_t_25 += __pyx_pybuffernd_counts.diminfo[0].shape;
      if (unlikely(__pyx_t_25 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_25 >= __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 = 1869; __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_25, __pyx_pybuffernd_counts.diminfo[0].strides)) >= __pyx_v_minp) != 0);
    if (__pyx_t_4) {

      /* "pandas/algos.pyx":1870
 *         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 = 1870; __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_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_17 = PyNumber_Add(__pyx_t_12, __pyx_t_1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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 = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      if (likely(PyDict_Check(__pyx_v_kwargs))) {
        __pyx_t_1 = __pyx_v_kwargs;
        __Pyx_INCREF(__pyx_t_1);
      } else {
        __pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kwargs, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_t_12 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_17, __pyx_t_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_21 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_26 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_26 < 0) {
        __pyx_t_26 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_26 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_26 >= __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 = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_t_21;
      goto __pyx_L10;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1872
 *             output[i] = func(bufarr, *args, **kwargs)
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 *     bufarr.data = <char*> oldbuf
 * 
 */
      __pyx_t_27 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_27 < 0) {
        __pyx_t_27 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_27 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_27 >= __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 = 1872; __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_6pandas_5algos_NaN;
    }
    __pyx_L10:;
  }

  /* "pandas/algos.pyx":1873
 *         else:
 *             output[i] = NaN
 *     bufarr.data = <char*> oldbuf             # <<<<<<<<<<<<<<
 * 
 *     # truncated windows at the end
 */
  __pyx_v_bufarr->data = ((char *)__pyx_v_oldbuf);

  /* "pandas/algos.pyx":1876
 * 
 *     # truncated windows at the end
 *     for i from int_max(n - offset, 0) <= i < n:             # <<<<<<<<<<<<<<
 *         if counts[i] >= minp:
 *             output[i] = func(input[int_max(i + offset - win + 1, 0) : n], *args, **kwargs)
 */
  __pyx_t_24 = __pyx_v_n;
  for (__pyx_v_i = __pyx_f_6pandas_5algos_int_max((__pyx_v_n - __pyx_v_offset), 0); __pyx_v_i < __pyx_t_24; __pyx_v_i++) {

    /* "pandas/algos.pyx":1877
 *     # truncated windows at the end
 *     for i from int_max(n - offset, 0) <= i < n:
 *         if counts[i] >= minp:             # <<<<<<<<<<<<<<
 *             output[i] = func(input[int_max(i + offset - win + 1, 0) : n], *args, **kwargs)
 *         else:
 */
    __pyx_t_28 = __pyx_v_i;
    __pyx_t_6 = -1;
    if (__pyx_t_28 < 0) {
      __pyx_t_28 += __pyx_pybuffernd_counts.diminfo[0].shape;
      if (unlikely(__pyx_t_28 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_28 >= __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 = 1877; __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_28, __pyx_pybuffernd_counts.diminfo[0].strides)) >= __pyx_v_minp) != 0);
    if (__pyx_t_4) {

      /* "pandas/algos.pyx":1878
 *     for i from int_max(n - offset, 0) <= i < n:
 *         if counts[i] >= minp:
 *             output[i] = func(input[int_max(i + offset - win + 1, 0) : n], *args, **kwargs)             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
      __pyx_t_12 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_input), __pyx_f_6pandas_5algos_int_max((((__pyx_v_i + __pyx_v_offset) - __pyx_v_win) + 1), 0), __pyx_v_n, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __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 = 1878; __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 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_17 = PyNumber_Add(__pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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 = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      if (likely(PyDict_Check(__pyx_v_kwargs))) {
        __pyx_t_12 = __pyx_v_kwargs;
        __Pyx_INCREF(__pyx_t_12);
      } else {
        __pyx_t_12 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kwargs, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
      }
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_17, __pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_21 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_29 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_29 < 0) {
        __pyx_t_29 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_29 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_29 >= __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 = 1878; __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_t_21;
      goto __pyx_L13;
    }
    /*else*/ {

      /* "pandas/algos.pyx":1880
 *             output[i] = func(input[int_max(i + offset - win + 1, 0) : n], *args, **kwargs)
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __pyx_t_30 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_30 < 0) {
        __pyx_t_30 += __pyx_pybuffernd_output.diminfo[0].shape;
        if (unlikely(__pyx_t_30 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_30 >= __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 = 1880; __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_6pandas_5algos_NaN;
    }
    __pyx_L13:;
  }

  /* "pandas/algos.pyx":1882
 *             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":1836
 *     return output
 * 
 * def roll_generic(ndarray[float64_t, cast=True] input,             # <<<<<<<<<<<<<<
 *                  int win, int minp, int offset,
 *                  object func, object args, object kwargs):
 */

  /* 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);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  { 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":1885
 * 
 * 
 * def roll_window(ndarray[float64_t, ndim=1, cast=True] input,             # <<<<<<<<<<<<<<
 *                 ndarray[float64_t, ndim=1, cast=True] weights,
 *                 int minp, bint avg=True):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_57roll_window(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_56roll_window[] = "\n    Assume len(weights) << len(input)\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_57roll_window = {"roll_window", (PyCFunction)__pyx_pw_6pandas_5algos_57roll_window, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_56roll_window};
static PyObject *__pyx_pw_6pandas_5algos_57roll_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_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,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_weights)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_window", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __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, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __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--; }
        }
      }
      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 = 1885; __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_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 = 1887; __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 = 1887; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "pandas/algos.pyx":1887
 * def roll_window(ndarray[float64_t, ndim=1, cast=True] input,
 *                 ndarray[float64_t, ndim=1, cast=True] weights,
 *                 int minp, bint avg=True):             # <<<<<<<<<<<<<<
 *     """
 *     Assume len(weights) << len(input)
 */
      __pyx_v_avg = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("roll_window", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __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 = 1885; __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 = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_56roll_window(__pyx_self, __pyx_v_input, __pyx_v_weights, __pyx_v_minp, __pyx_v_avg);

  /* "pandas/algos.pyx":1885
 * 
 * 
 * def roll_window(ndarray[float64_t, ndim=1, cast=True] input,             # <<<<<<<<<<<<<<
 *                 ndarray[float64_t, ndim=1, cast=True] weights,
 *                 int minp, bint avg=True):
 */

  /* 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_56roll_window(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, PyArrayObject *__pyx_v_weights, int __pyx_v_minp, int __pyx_v_avg) {
  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;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__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;
  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;
  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 = 1885; __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 = 1885; __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":1896
 *         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 = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_in_n = __pyx_t_1;

  /* "pandas/algos.pyx":1897
 * 
 *     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 = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_win_n = __pyx_t_1;

  /* "pandas/algos.pyx":1898
 *     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 = 1898; __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 = 1898; __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 = 1898; __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 = 1898; __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 = 1898; __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 = 1898; __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 = 1898; __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 = 1898; __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 = 1898; __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":1899
 *     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 = 1899; __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 = 1899; __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 = 1899; __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 = 1899; __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 = 1899; __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 = 1899; __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 = 1899; __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 = 1899; __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 = 1899; __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":1900
 *     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":1901
 *     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 = 1901; __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 = 1901; __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 = 1901; __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 = 1901; __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 = 1901; __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 = 1901; __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 = 1901; __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 = 1901; __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 = 1901; __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":1903
 *         tot_wgt = np.zeros(in_n, dtype=float)
 * 
 *     minp = _check_minp(len(weights), minp, in_n)             # <<<<<<<<<<<<<<
 * 
 *     if avg:
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_weights)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_in_n); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = NULL;
  __pyx_t_1 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_13)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_1 = 1;
    }
  }
  __pyx_t_14 = PyTuple_New(3+__pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  if (__pyx_t_13) {
    PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = NULL;
  }
  PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_1, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_12 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_minp = __pyx_t_7;

  /* "pandas/algos.pyx":1905
 *     minp = _check_minp(len(weights), minp, in_n)
 * 
 *     if avg:             # <<<<<<<<<<<<<<
 *         for win_i from 0 <= win_i < win_n:
 *             val_win = weights[win_i]
 */
  __pyx_t_11 = (__pyx_v_avg != 0);
  if (__pyx_t_11) {

    /* "pandas/algos.pyx":1906
 * 
 *     if avg:
 *         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":1907
 *     if avg:
 *         for win_i from 0 <= win_i < win_n:
 *             val_win = weights[win_i]             # <<<<<<<<<<<<<<
 *             if val_win != val_win:
 *                 continue
 */
      __pyx_t_15 = __pyx_v_win_i;
      __pyx_t_7 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_pybuffernd_weights.diminfo[0].shape;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_15 >= __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 = 1907; __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_15, __pyx_pybuffernd_weights.diminfo[0].strides));

      /* "pandas/algos.pyx":1908
 *         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":1909
 *             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":1911
 *                 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_16 = ((__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_16; __pyx_v_in_i++) {

        /* "pandas/algos.pyx":1912
 * 
 *             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_17 = __pyx_v_in_i;
        __pyx_t_7 = -1;
        if (__pyx_t_17 < 0) {
          __pyx_t_17 += __pyx_pybuffernd_input.diminfo[0].shape;
          if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_17 >= __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 = 1912; __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_17, __pyx_pybuffernd_input.diminfo[0].strides));

        /* "pandas/algos.pyx":1913
 *             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":1914
 *                 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_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_output.diminfo[0].shape;
            if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_18 >= __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 = 1914; __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_val_in * __pyx_v_val_win);

          /* "pandas/algos.pyx":1915
 *                 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_19 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1);
          __pyx_t_7 = -1;
          if (__pyx_t_19 < 0) {
            __pyx_t_19 += __pyx_pybuffernd_counts.diminfo[0].shape;
            if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_19 >= __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 = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_counts.diminfo[0].strides) += 1.0;

          /* "pandas/algos.pyx":1916
 *                     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_20 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1);
          __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 = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_tot_wgt.diminfo[0].strides) += __pyx_v_val_win;
          goto __pyx_L10;
        }
        __pyx_L10:;
      }
      __pyx_L5_continue:;
    }

    /* "pandas/algos.pyx":1918
 *                     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":1919
 * 
 *         for in_i from 0 <= in_i < in_n:
 *             c = counts[in_i]             # <<<<<<<<<<<<<<
 *             if c < minp:
 *                 output[in_i] = NaN
 */
      __pyx_t_16 = __pyx_v_in_i;
      __pyx_t_7 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_counts.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_16 >= __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 = 1919; __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_16, __pyx_pybuffernd_counts.diminfo[0].strides));

      /* "pandas/algos.pyx":1920
 *         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":1921
 *             c = counts[in_i]
 *             if c < minp:
 *                 output[in_i] = NaN             # <<<<<<<<<<<<<<
 *             else:
 *                 w = 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 = 1921; __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_L13;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1923
 *                 output[in_i] = NaN
 *             else:
 *                 w = tot_wgt[in_i]             # <<<<<<<<<<<<<<
 *                 if w == 0:
 *                     output[in_i] = NaN
 */
        __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 = 1923; __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_22, __pyx_pybuffernd_tot_wgt.diminfo[0].strides));

        /* "pandas/algos.pyx":1924
 *             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":1925
 *                 w = tot_wgt[in_i]
 *                 if w == 0:
 *                     output[in_i] = NaN             # <<<<<<<<<<<<<<
 *                 else:
 *                     output[in_i] /= tot_wgt[in_i]
 */
          __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 = 1925; __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_v_6pandas_5algos_NaN;
          goto __pyx_L14;
        }
        /*else*/ {

          /* "pandas/algos.pyx":1927
 *                     output[in_i] = NaN
 *                 else:
 *                     output[in_i] /= tot_wgt[in_i]             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
          __pyx_t_24 = __pyx_v_in_i;
          __pyx_t_7 = -1;
          if (__pyx_t_24 < 0) {
            __pyx_t_24 += __pyx_pybuffernd_tot_wgt.diminfo[0].shape;
            if (unlikely(__pyx_t_24 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_24 >= __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 = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_25 = __pyx_v_in_i;
          __pyx_t_7 = -1;
          if (__pyx_t_25 < 0) {
            __pyx_t_25 += __pyx_pybuffernd_output.diminfo[0].shape;
            if (unlikely(__pyx_t_25 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_25 >= __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 = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_output.diminfo[0].strides) /= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_tot_wgt.diminfo[0].strides));
        }
        __pyx_L14:;
      }
      __pyx_L13:;
    }
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/algos.pyx":1930
 * 
 *     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":1931
 *     else:
 *         for win_i from 0 <= win_i < win_n:
 *             val_win = weights[win_i]             # <<<<<<<<<<<<<<
 *             if val_win != val_win:
 *                 continue
 */
      __pyx_t_26 = __pyx_v_win_i;
      __pyx_t_7 = -1;
      if (__pyx_t_26 < 0) {
        __pyx_t_26 += __pyx_pybuffernd_weights.diminfo[0].shape;
        if (unlikely(__pyx_t_26 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_26 >= __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 = 1931; __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_26, __pyx_pybuffernd_weights.diminfo[0].strides));

      /* "pandas/algos.pyx":1932
 *         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":1933
 *             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":1935
 *                 continue
 * 
 *             for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1:             # <<<<<<<<<<<<<<
 *                 val_in = input[in_i]
 * 
 */
      __pyx_t_27 = ((__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_27; __pyx_v_in_i++) {

        /* "pandas/algos.pyx":1936
 * 
 *             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_28 = __pyx_v_in_i;
        __pyx_t_7 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_28 += __pyx_pybuffernd_input.diminfo[0].shape;
          if (unlikely(__pyx_t_28 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_28 >= __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 = 1936; __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_28, __pyx_pybuffernd_input.diminfo[0].strides));

        /* "pandas/algos.pyx":1938
 *                 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":1939
 * 
 *                 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_29 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1);
          __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 = 1939; __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_val_in * __pyx_v_val_win);

          /* "pandas/algos.pyx":1940
 *                 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_30 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1);
          __pyx_t_7 = -1;
          if (__pyx_t_30 < 0) {
            __pyx_t_30 += __pyx_pybuffernd_counts.diminfo[0].shape;
            if (unlikely(__pyx_t_30 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_30 >= __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 = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_counts.diminfo[0].strides) += 1.0;
          goto __pyx_L20;
        }
        __pyx_L20:;
      }
      __pyx_L15_continue:;
    }

    /* "pandas/algos.pyx":1942
 *                     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":1943
 * 
 *         for in_i from 0 <= in_i < in_n:
 *             c = counts[in_i]             # <<<<<<<<<<<<<<
 *             if c < minp:
 *                 output[in_i] = NaN
 */
      __pyx_t_27 = __pyx_v_in_i;
      __pyx_t_7 = -1;
      if (__pyx_t_27 < 0) {
        __pyx_t_27 += __pyx_pybuffernd_counts.diminfo[0].shape;
        if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_27 >= __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 = 1943; __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_27, __pyx_pybuffernd_counts.diminfo[0].strides));

      /* "pandas/algos.pyx":1944
 *         for in_i from 0 <= in_i < in_n:
 *             c = counts[in_i]
 *             if c < minp:             # <<<<<<<<<<<<<<
 *                 output[in_i] = NaN
 * 
 */
      __pyx_t_11 = ((__pyx_v_c < __pyx_v_minp) != 0);
      if (__pyx_t_11) {

        /* "pandas/algos.pyx":1945
 *             c = counts[in_i]
 *             if c < minp:
 *                 output[in_i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
        __pyx_t_31 = __pyx_v_in_i;
        __pyx_t_7 = -1;
        if (__pyx_t_31 < 0) {
          __pyx_t_31 += __pyx_pybuffernd_output.diminfo[0].shape;
          if (unlikely(__pyx_t_31 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_31 >= __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 = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN;
        goto __pyx_L23;
      }
      __pyx_L23:;
    }
  }
  __pyx_L4:;

  /* "pandas/algos.pyx":1947
 *                 output[in_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":1885
 * 
 * 
 * def roll_window(ndarray[float64_t, ndim=1, cast=True] input,             # <<<<<<<<<<<<<<
 *                 ndarray[float64_t, ndim=1, cast=True] weights,
 *                 int minp, bint avg=True):
 */

  /* 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);
  __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_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":1956
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def is_lexsorted(list list_of_arrays):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int i
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_59is_lexsorted(PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_59is_lexsorted = {"is_lexsorted", (PyCFunction)__pyx_pw_6pandas_5algos_59is_lexsorted, METH_O, 0};
static PyObject *__pyx_pw_6pandas_5algos_59is_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 = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_58is_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_58is_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":1963
 *         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 = 1963; __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 = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nlevels = __pyx_t_1;

  /* "pandas/algos.pyx":1964
 * 
 *     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 = 1964; __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 = 1964; __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":1966
 *     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":1967
 * 
 *     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":1970
 *         # 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 = 1970; __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 = 1970; __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":1971
 * 
 *         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":1974
 *     # 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":1975
 * 
 *     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":1976
 *     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":1977
 *         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":1978
 *             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":1979
 *             pre = vecs[k][i-1]
 *             if cur == pre:
 *                 continue             # <<<<<<<<<<<<<<
 *             elif cur > pre:
 *                 break
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/algos.pyx":1980
 *             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":1981
 *                 continue
 *             elif cur > pre:
 *                 break             # <<<<<<<<<<<<<<
 *             else:
 *                 return False
 */
        goto __pyx_L8_break;
      }
      /*else*/ {

        /* "pandas/algos.pyx":1983
 *                 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":1984
 *             else:
 *                 return False
 *     free(vecs)             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
  free(__pyx_v_vecs);

  /* "pandas/algos.pyx":1985
 *                 return False
 *     free(vecs)
 *     return True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "pandas/algos.pyx":1956
 * @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":1989
 * 
 * @cython.boundscheck(False)
 * def groupby_indices(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_61groupby_indices(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_61groupby_indices = {"groupby_indices", (PyCFunction)__pyx_pw_6pandas_5algos_61groupby_indices, METH_O, 0};
static PyObject *__pyx_pw_6pandas_5algos_61groupby_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 = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_60groupby_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_60groupby_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":1991
 * 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 = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/algos.pyx":1994
 *         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 = 1994; __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":1998
 *         int64_t k
 * 
 *     ids, labels, counts = group_labels(values)             # <<<<<<<<<<<<<<
 *     seen = np.zeros_like(counts)
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_group_labels); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_values)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_values));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_values));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __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;
  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 = 1998; __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_5 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    __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 = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __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_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 2; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __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 = 1998; __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 = 1998; __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 = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __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_5);
  {
    __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 = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_labels = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __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 = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/algos.pyx":1999
 * 
 *     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 = 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_like); 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 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_counts)); 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);
  } else {
    __pyx_t_3 = PyTuple_New(1+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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_counts));
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_counts));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_counts));
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); 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_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 = 1999; __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 = 1999; __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":2002
 * 
 *     # 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 = 2002; __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 = 2002; __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":2003
 *     # 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 = 2003; __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":2004
 *     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 = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/algos.pyx":2005
 *     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 = 2005; __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 = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __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 = 2005; __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 = 2005; __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[0]; __pyx_lineno = 2005; __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[0]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2005; __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_3); __pyx_t_3 = 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 = 2005; __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 = 2005; __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":2006
 *     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 = 2006; __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 = 2006; __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 = 2006; __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 = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/algos.pyx":2007
 *         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":2009
 *         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":2010
 * 
 *     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":2013
 * 
 *         # was NaN
 *         if k == -1:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_15 = ((__pyx_v_k == -1) != 0);
    if (__pyx_t_15) {

      /* "pandas/algos.pyx":2014
 *         # was NaN
 *         if k == -1:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         loc = seen[k]
 */
      goto __pyx_L7_continue;
    }

    /* "pandas/algos.pyx":2016
 *             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":2017
 * 
 *         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":2018
 *         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":2020
 *         seen[k] = loc + 1
 * 
 *     free(vecs)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  free(__pyx_v_vecs);

  /* "pandas/algos.pyx":2022
 *     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":1989
 * 
 * @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":2026
 * @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_63group_labels(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static char __pyx_doc_6pandas_5algos_62group_labels[] = "\n    Compute label vector from input values and associated useful data\n\n    Returns\n    -------\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_63group_labels = {"group_labels", (PyCFunction)__pyx_pw_6pandas_5algos_63group_labels, METH_O, __pyx_doc_6pandas_5algos_62group_labels};
static PyObject *__pyx_pw_6pandas_5algos_63group_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 = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_62group_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_62group_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 = 2026; __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":2034
 *     '''
 *     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 = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/algos.pyx":2035
 *     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 = 2035; __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 = 2035; __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 = 2035; __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 = 2035; __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 = 2035; __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 = 2035; __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 = 2035; __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 = 2035; __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 = 2035; __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 = 2035; __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 = 2035; __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":2036
 *         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 = 2036; __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 = 2036; __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 = 2036; __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 = 2036; __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 = 2036; __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 = 2036; __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 = 2036; __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 = 2036; __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 = 2036; __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 = 2036; __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 = 2036; __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":2037
 *         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 = 2037; __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 = 2037; __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":2040
 *         int64_t idx
 *         object val
 *         int64_t count = 0             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_v_count = 0;

  /* "pandas/algos.pyx":2042
 *         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":2043
 * 
 *     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":2046
 * 
 *         # 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 = 2046; __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 = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_10) {

      /* "pandas/algos.pyx":2047
 *         # 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":2048
 *         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":2052
 *         # 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 = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_12 = (__pyx_t_10 != 0);
    if (__pyx_t_12) {

      /* "pandas/algos.pyx":2053
 *         # 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 = 2053; __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 = 2053; __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":2054
 *         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":2055
 *             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":2057
 *             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 = 2057; __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 = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pandas/algos.pyx":2058
 *         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 = 2058; __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 = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pandas/algos.pyx":2059
 *             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":2060
 *             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":2061
 *             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":2063
 *             count += 1
 * 
 *     return reverse, labels, counts[:count].copy()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_counts), 0, __pyx_v_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __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(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_reverse);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_reverse);
  __Pyx_GIVEREF(__pyx_v_reverse);
  __Pyx_INCREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_labels));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pandas/algos.pyx":2026
 * @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":2068
 * @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_65groupsort_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_65groupsort_indexer = {"groupsort_indexer", (PyCFunction)__pyx_pw_6pandas_5algos_65groupsort_indexer, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_65groupsort_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 = 2068; __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 = 2068; __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 = 2068; __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 = 2068; __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 = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_64groupsort_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_64groupsort_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 = 2068; __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":2074
 * 
 *     # 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 = 2074; __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 = 2074; __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 = 2074; __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 = 2074; __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 = 2074; __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 = 2074; __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 = 2074; __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 = 2074; __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 = 2074; __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 = 2074; __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 = 2074; __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":2075
 *     # 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 = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_11;

  /* "pandas/algos.pyx":2076
 *     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":2077
 *     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":2080
 * 
 *     # 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 = 2080; __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 = 2080; __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 = 2080; __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 = 2080; __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 = 2080; __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 = 2080; __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 = 2080; __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 = 2080; __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 = 2080; __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 = 2080; __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 = 2080; __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":2081
 *     # 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":2082
 *     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":2085
 * 
 *     # 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 = 2085; __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 = 2085; __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 = 2085; __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 = 2085; __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 = 2085; __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 = 2085; __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 = 2085; __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 = 2085; __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 = 2085; __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 = 2085; __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 = 2085; __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":2086
 *     # 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":2087
 *     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":2088
 *     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":2089
 *         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":2091
 *         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 = 2091; __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":2068
 * @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":2099
 * @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_67group_nth_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_66group_nth_object[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_67group_nth_object = {"group_nth_object", (PyCFunction)__pyx_pw_6pandas_5algos_67group_nth_object, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_66group_nth_object};
static PyObject *__pyx_pw_6pandas_5algos_67group_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 = 2099; __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 = 2099; __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 = 2099; __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 = 2099; __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 = 2099; __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 = 2103; __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 = 2099; __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 = 2099; __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 = 2100; __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 = 2101; __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 = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_66group_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_66group_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 = 2099; __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 = 2099; __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 = 2099; __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 = 2099; __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":2114
 *         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 = 2114; __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 = 2114; __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 = 2114; __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 = 2114; __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 = 2114; __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 = 2114; __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 = 2114; __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 = 2114; __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 = 2114; __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 = 2114; __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 = 2114; __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":2115
 * 
 *     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 = 2115; __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 = 2115; __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 = 2115; __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 = 2115; __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 = 2115; __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 = 2115; __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 = 2115; __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 = 2115; __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 = 2115; __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":2117
 *     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 = 2117; __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 = 2117; __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 = 2117; __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 = 2117; __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 = 2117; __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 = 2117; __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 = 2117; __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 = 2117; __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 = 2117; __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":2119
 *     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":2120
 * 
 *     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":2121
 *     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":2122
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L5_continue;
    }

    /* "pandas/algos.pyx":2124
 *             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":2125
 * 
 *         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":2126
 *         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":2129
 * 
 *             # 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 = 2129; __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 = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_16) {

        /* "pandas/algos.pyx":2130
 *             # 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":2131
 *             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":2132
 *                 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":2134
 *                     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 = 2134; __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":2135
 * 
 *     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":2136
 *     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":2137
 *         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 = 2137; __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":2139
 *                 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":2099
 * @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":2143
 * @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_69group_nth_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_68group_nth_bin_object[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_69group_nth_bin_object = {"group_nth_bin_object", (PyCFunction)__pyx_pw_6pandas_5algos_69group_nth_bin_object, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_68group_nth_bin_object};
static PyObject *__pyx_pw_6pandas_5algos_69group_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 = 2143; __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 = 2143; __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 = 2143; __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 = 2143; __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 = 2143; __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 = 2146; __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 = 2143; __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 = 2143; __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 = 2144; __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 = 2145; __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 = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_68group_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_68group_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 *);
  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;
  PyObject **__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;
  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 = 2143; __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 = 2143; __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 = 2143; __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 = 2143; __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":2157
 *         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 = 2157; __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 = 2157; __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 = 2157; __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 = 2157; __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 = 2157; __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 = 2157; __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 = 2157; __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 = 2157; __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 = 2157; __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 = 2157; __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 = 2157; __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":2158
 * 
 *     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 = 2158; __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 = 2158; __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 = 2158; __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 = 2158; __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 = 2158; __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 = 2158; __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 = 2158; __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 = 2158; __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 = 2158; __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":2160
 *     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 = 2160; __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 = 2160; __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":2161
 * 
 *     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 = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_14;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/algos.pyx":2163
 *         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 = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_14 + 1);
  }
  __pyx_L3:;

  /* "pandas/algos.pyx":2165
 *         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 = 2165; __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 = 2165; __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 = 2165; __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 = 2165; __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 = 2165; __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 = 2165; __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 = 2165; __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 = 2165; __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 = 2165; __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":2167
 *     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":2168
 * 
 *     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":2169
 *     b = 0
 *     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) {
      } else {
        __pyx_t_15 = __pyx_t_17;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_18 = __pyx_v_b;
      __pyx_t_17 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
      __pyx_t_15 = __pyx_t_17;
      __pyx_L10_bool_binop_done:;
      if (!__pyx_t_15) break;

      /* "pandas/algos.pyx":2170
 *     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":2172
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_19 = __pyx_v_b;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/algos.pyx":2173
 * 
 *         counts[b] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __pyx_t_20 = __pyx_v_K;
    for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
      __pyx_v_j = __pyx_t_21;

      /* "pandas/algos.pyx":2174
 *         counts[b] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_22 = __pyx_v_i;
      __pyx_t_23 = __pyx_v_j;
      __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_23, __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":2177
 * 
 *             # 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 = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_15) {

        /* "pandas/algos.pyx":2178
 *             # not nan
 *             if val == val:
 *                 nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                 if nobs[b, j] == rank:
 *                     resx[b, j] = val
 */
        __pyx_t_24 = __pyx_v_b;
        __pyx_t_25 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_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) += 1.0;

        /* "pandas/algos.pyx":2179
 *             if val == val:
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:             # <<<<<<<<<<<<<<
 *                     resx[b, j] = val
 * 
 */
        __pyx_t_26 = __pyx_v_b;
        __pyx_t_27 = __pyx_v_j;
        __pyx_t_15 = (((*__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)) == __pyx_v_rank) != 0);
        if (__pyx_t_15) {

          /* "pandas/algos.pyx":2180
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:
 *                     resx[b, j] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
          __pyx_t_28 = __pyx_v_b;
          __pyx_t_29 = __pyx_v_j;
          __pyx_t_30 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_resx.diminfo[1].strides);
          __Pyx_GOTREF(*__pyx_t_30);
          __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_30);
          *__pyx_t_30 = __pyx_v_val;
          __Pyx_GIVEREF(*__pyx_t_30);
          goto __pyx_L15;
        }
        __pyx_L15:;
        goto __pyx_L14;
      }
      __pyx_L14:;
    }
  }

  /* "pandas/algos.pyx":2182
 *                     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":2183
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_20 = __pyx_v_K;
    for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
      __pyx_v_j = __pyx_t_21;

      /* "pandas/algos.pyx":2184
 *     for i in range(ngroups):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_31 = __pyx_v_i;
      __pyx_t_32 = __pyx_v_j;
      __pyx_t_15 = (((*__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)) == 0.0) != 0);
      if (__pyx_t_15) {

        /* "pandas/algos.pyx":2185
 *         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 = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_33 = __pyx_v_i;
        __pyx_t_34 = __pyx_v_j;
        __pyx_t_30 = __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_30);
        __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_30);
        *__pyx_t_30 = __pyx_t_2;
        __Pyx_GIVEREF(*__pyx_t_30);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L20;
      }
      /*else*/ {

        /* "pandas/algos.pyx":2187
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
        __pyx_t_35 = __pyx_v_i;
        __pyx_t_36 = __pyx_v_j;
        __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_resx.diminfo[1].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_2);
        __pyx_t_37 = __pyx_v_i;
        __pyx_t_38 = __pyx_v_j;
        __pyx_t_30 = __Pyx_BufPtrStrided2d(PyObject **, __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_GOTREF(*__pyx_t_30);
        __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_30);
        *__pyx_t_30 = __pyx_t_2;
        __Pyx_GIVEREF(*__pyx_t_30);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_L20:;
    }
  }

  /* "pandas/algos.pyx":2143
 * @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":2191
 * @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_71group_last_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_70group_last_object[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_71group_last_object = {"group_last_object", (PyCFunction)__pyx_pw_6pandas_5algos_71group_last_object, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_70group_last_object};
static PyObject *__pyx_pw_6pandas_5algos_71group_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 = 2191; __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 = 2191; __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 = 2191; __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 = 2191; __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 = 2191; __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 = 2191; __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 = 2192; __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 = 2193; __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 = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_70group_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_70group_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 = 2191; __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 = 2191; __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 = 2191; __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 = 2191; __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":2205
 *         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 = 2205; __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 = 2205; __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 = 2205; __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 = 2205; __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 = 2205; __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 = 2205; __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 = 2205; __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 = 2205; __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 = 2205; __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 = 2205; __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 = 2205; __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":2206
 * 
 *     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 = 2206; __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 = 2206; __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 = 2206; __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 = 2206; __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 = 2206; __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 = 2206; __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 = 2206; __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 = 2206; __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 = 2206; __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":2208
 *     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 = 2208; __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 = 2208; __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 = 2208; __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 = 2208; __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 = 2208; __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 = 2208; __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 = 2208; __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 = 2208; __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 = 2208; __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":2210
 *     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":2211
 * 
 *     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":2212
 *     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":2213
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L5_continue;
    }

    /* "pandas/algos.pyx":2215
 *             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":2216
 * 
 *         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":2217
 *         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":2220
 * 
 *             # 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 = 2220; __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 = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_16) {

        /* "pandas/algos.pyx":2221
 *             # 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":2222
 *             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":2224
 *                 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 = 2224; __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":2225
 * 
 *     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":2226
 *     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":2227
 *         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 = 2227; __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":2229
 *                 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":2191
 * @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":2233
 * @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_73group_last_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_72group_last_bin_object[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_73group_last_bin_object = {"group_last_bin_object", (PyCFunction)__pyx_pw_6pandas_5algos_73group_last_bin_object, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_72group_last_bin_object};
static PyObject *__pyx_pw_6pandas_5algos_73group_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 = 2233; __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 = 2233; __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 = 2233; __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 = 2233; __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 = 2233; __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 = 2233; __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 = 2234; __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 = 2235; __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 = 2236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_72group_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_72group_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 *);
  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;
  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_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 = 2233; __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 = 2233; __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 = 2233; __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 = 2233; __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":2247
 *         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 = 2247; __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 = 2247; __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 = 2247; __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 = 2247; __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 = 2247; __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 = 2247; __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 = 2247; __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 = 2247; __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 = 2247; __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 = 2247; __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 = 2247; __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":2248
 * 
 *     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 = 2248; __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 = 2248; __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 = 2248; __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 = 2248; __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 = 2248; __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 = 2248; __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 = 2248; __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 = 2248; __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 = 2248; __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":2250
 *     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 = 2250; __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 = 2250; __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":2251
 * 
 *     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 = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_14;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/algos.pyx":2253
 *         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 = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_14 + 1);
  }
  __pyx_L3:;

  /* "pandas/algos.pyx":2255
 *         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 = 2255; __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 = 2255; __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 = 2255; __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 = 2255; __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 = 2255; __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 = 2255; __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 = 2255; __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 = 2255; __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 = 2255; __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":2257
 *     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":2258
 * 
 *     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":2259
 *     b = 0
 *     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) {
      } else {
        __pyx_t_15 = __pyx_t_17;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_18 = __pyx_v_b;
      __pyx_t_17 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
      __pyx_t_15 = __pyx_t_17;
      __pyx_L10_bool_binop_done:;
      if (!__pyx_t_15) break;

      /* "pandas/algos.pyx":2260
 *     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":2262
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_19 = __pyx_v_b;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/algos.pyx":2263
 * 
 *         counts[b] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __pyx_t_20 = __pyx_v_K;
    for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
      __pyx_v_j = __pyx_t_21;

      /* "pandas/algos.pyx":2264
 *         counts[b] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_22 = __pyx_v_i;
      __pyx_t_23 = __pyx_v_j;
      __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_23, __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":2267
 * 
 *             # 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 = 2267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_15) {

        /* "pandas/algos.pyx":2268
 *             # not nan
 *             if val == val:
 *                 nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                 resx[b, j] = val
 * 
 */
        __pyx_t_24 = __pyx_v_b;
        __pyx_t_25 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_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) += 1.0;

        /* "pandas/algos.pyx":2269
 *             if val == val:
 *                 nobs[b, j] += 1
 *                 resx[b, j] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_26 = __pyx_v_b;
        __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_L14;
      }
      __pyx_L14:;
    }
  }

  /* "pandas/algos.pyx":2271
 *                 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":2272
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_20 = __pyx_v_K;
    for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
      __pyx_v_j = __pyx_t_21;

      /* "pandas/algos.pyx":2273
 *     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_15 = (((*__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_15) {

        /* "pandas/algos.pyx":2274
 *         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 = 2274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __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_2); __Pyx_DECREF(*__pyx_t_28);
        *__pyx_t_28 = __pyx_t_2;
        __Pyx_GIVEREF(*__pyx_t_28);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L19;
      }
      /*else*/ {

        /* "pandas/algos.pyx":2276
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_33 = __pyx_v_i;
        __pyx_t_34 = __pyx_v_j;
        __pyx_t_2 = (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_2);
        __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_2); __Pyx_DECREF(*__pyx_t_28);
        *__pyx_t_28 = __pyx_t_2;
        __Pyx_GIVEREF(*__pyx_t_28);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_L19:;
    }
  }

  /* "pandas/algos.pyx":2233
 * @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":2283
 * # 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_75group_median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_74group_median[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_75group_median = {"group_median", (PyCFunction)__pyx_pw_6pandas_5algos_75group_median, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_74group_median};
static PyObject *__pyx_pw_6pandas_5algos_75group_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 = 2283; __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 = 2283; __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 = 2283; __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 = 2283; __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 = 2283; __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 = 2283; __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 = 2284; __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 = 2285; __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 = 2286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_74group_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_74group_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;
  PyObject *__pyx_t_8 = NULL;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  long __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  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 = 2283; __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 = 2283; __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 = 2283; __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 = 2283; __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":2295
 *         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 = 2295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ngroups = __pyx_t_1;

  /* "pandas/algos.pyx":2296
 *         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 = 2296; __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 = 2296; __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 = 2296; __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 = 2296; __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 = 2296; __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 = 2296; __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 = 2296; __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 = 2296; __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 = 2296; __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":2298
 *     N, K = (<object> values).shape
 * 
 *     indexer, _counts = groupsort_indexer(labels, ngroups)             # <<<<<<<<<<<<<<
 *     counts[:] = _counts[1:]
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_ngroups); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_5) {
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)__pyx_v_labels));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __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 = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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[0]; __pyx_lineno = 2298; __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_8 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_8);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_8 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_8)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L6_unpacking_done:;
  }
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_indexer = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__counts.rcbuffer->pybuffer);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd__counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_10 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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__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_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = 0;
  __pyx_v__counts = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pandas/algos.pyx":2299
 * 
 *     indexer, _counts = groupsort_indexer(labels, ngroups)
 *     counts[:] = _counts[1:]             # <<<<<<<<<<<<<<
 * 
 *     data = np.empty((K, N), dtype=np.float64)
 */
  __pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v__counts), 1, 0, NULL, NULL, &__pyx_slice__44, 1, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_counts), __pyx_t_2, 0, 0, NULL, NULL, &__pyx_slice__45, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/algos.pyx":2301
 *     counts[:] = _counts[1:]
 * 
 *     data = np.empty((K, N), dtype=np.float64)             # <<<<<<<<<<<<<<
 *     ptr = <float64_t*> data.data
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __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 = 2301; __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);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __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 = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_data = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/algos.pyx":2302
 * 
 *     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":2304
 *     ptr = <float64_t*> data.data
 * 
 *     take_2d_axis1_float64_float64(values.T, indexer, out=data)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(K):
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_take_2d_axis1_float64_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_T); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2304; __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_INCREF(__pyx_v_indexer);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_indexer);
  __Pyx_GIVEREF(__pyx_v_indexer);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_out, ((PyObject *)__pyx_v_data)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2304; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pandas/algos.pyx":2306
 *     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":2308
 *     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_10 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_pybuffernd__counts.diminfo[0].shape;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_14 >= __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[0]; __pyx_lineno = 2308; __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":2309
 *         # 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":2310
 *         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_10 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd__counts.diminfo[0].shape;
        if (unlikely(__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[0]; __pyx_lineno = 2310; __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":2311
 *         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_10 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_pybuffernd_out.diminfo[0].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_10 = 0;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_pybuffernd_out.diminfo[1].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 1;
      } else if (unlikely(__pyx_t_19 >= __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[0]; __pyx_lineno = 2311; __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":2312
 *             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":2283
 * # 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_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_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":2315
 * 
 * 
 * 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":2316
 * 
 * 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":2321
 * 
 *     # 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":2322
 *     # 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":2323
 *     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":2325
 *             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":2326
 * 
 *     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":2327
 *     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":2329
 *             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":2331
 *         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":2332
 * 
 *         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":2333
 *         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":2334
 *         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":2335
 *             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":2337
 *                 j += 1
 * 
 *         a = tmp             # <<<<<<<<<<<<<<
 *         n -= na_count
 * 
 */
    __pyx_v_a = __pyx_v_tmp;

    /* "pandas/algos.pyx":2338
 * 
 *         a = tmp
 *         n -= na_count             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_n = (__pyx_v_n - __pyx_v_na_count);
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pandas/algos.pyx":2341
 * 
 * 
 *     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":2342
 * 
 *     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 = 2342; __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 = 2342; __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":2344
 *         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 = 2344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);

    /* "pandas/algos.pyx":2345
 *     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 = 2345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);

    /* "pandas/algos.pyx":2344
 *         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 = 2344; __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":2345
 *     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 = 2345; __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 = 2345; __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":2347
 *                   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":2348
 * 
 *     if na_count:
 *         free(a)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    free(__pyx_v_a);
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "pandas/algos.pyx":2350
 *         free(a)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * include "join.pyx"
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pandas/algos.pyx":2315
 * 
 * 
 * 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_77inner_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_77inner_join = {"inner_join", (PyCFunction)__pyx_pw_6pandas_5algos_77inner_join, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_77inner_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_76inner_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_76inner_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;
  Py_ssize_t __pyx_t_5;
  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;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  long __pyx_t_18;
  long __pyx_t_19;
  PyArrayObject *__pyx_t_20 = NULL;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  __pyx_t_5numpy_int64_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("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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); 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 = PyInt_FromSsize_t(__pyx_v_max_groups); 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_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4) {
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_left));
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_left));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left));
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); 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_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 11; __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_6 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_6);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); 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_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_1); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_6 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = 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_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_sorter.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_left_sorter = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_left_count = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 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_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_max_groups); 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_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_5); 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);
  if (__pyx_t_3) {
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_right));
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, ((PyObject *)__pyx_v_right));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right));
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, 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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_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[3]; __pyx_lineno = 12; __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[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_2 = PyObject_GetIter(__pyx_t_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);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = 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_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_sorter.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_right_sorter = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_right_count = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 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_5 = (__pyx_v_max_groups + 1);
  for (__pyx_t_13 = 1; __pyx_t_13 < __pyx_t_5; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "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_14 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_pybuffernd_left_count.diminfo[0].shape;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__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_14, __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_15 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_right_count.diminfo[0].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__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_15, __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_17 = ((__pyx_v_rc > 0) != 0);
    if (__pyx_t_17) {
    } else {
      __pyx_t_16 = __pyx_t_17;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_17 = ((__pyx_v_lc > 0) != 0);
    __pyx_t_16 = __pyx_t_17;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_16) {

      /* "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_9 = -1;
  if (__pyx_t_18 < 0) {
    __pyx_t_18 += __pyx_pybuffernd_left_count.diminfo[0].shape;
    if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    {__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_9 = -1;
  if (__pyx_t_19 < 0) {
    __pyx_t_19 += __pyx_pybuffernd_right_count.diminfo[0].shape;
    if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    {__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_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); 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_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_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); 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);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_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);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_20 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__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_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_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __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_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_20 = 0;
  __pyx_v_left_indexer = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __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_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_count); 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);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_3); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_20 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_20 = 0;
  __pyx_v_right_indexer = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 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_5 = (__pyx_v_max_groups + 1);
  for (__pyx_t_13 = 1; __pyx_t_13 < __pyx_t_5; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "pandas/src/join.pyx":35
 * 
 *     for i in range(1, max_groups + 1):
 *         lc = left_count[i]             # <<<<<<<<<<<<<<
 *         rc = right_count[i]
 * 
 */
    __pyx_t_21 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_21 < 0) {
      __pyx_t_21 += __pyx_pybuffernd_left_count.diminfo[0].shape;
      if (unlikely(__pyx_t_21 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__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_21, __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_22 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_22 < 0) {
      __pyx_t_22 += __pyx_pybuffernd_right_count.diminfo[0].shape;
      if (unlikely(__pyx_t_22 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__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_22, __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) {
    } else {
      __pyx_t_16 = __pyx_t_17;
      goto __pyx_L15_bool_binop_done;
    }
    __pyx_t_17 = ((__pyx_v_lc > 0) != 0);
    __pyx_t_16 = __pyx_t_17;
    __pyx_L15_bool_binop_done:;
    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_23 = __pyx_v_lc;
      for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
        __pyx_v_j = __pyx_t_24;

        /* "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_25 = __pyx_v_rc;
        for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
          __pyx_v_k = __pyx_t_26;

          /* "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_27 = (__pyx_v_offset + __pyx_v_k);
          __pyx_t_9 = -1;
          if (__pyx_t_27 < 0) {
            __pyx_t_27 += __pyx_pybuffernd_left_indexer.diminfo[0].shape;
            if (unlikely(__pyx_t_27 < 0)) __pyx_t_9 = 0;
          } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_9 = 0;
          if (unlikely(__pyx_t_9 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_9);
            {__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_27, __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_28 = (__pyx_v_offset + __pyx_v_k);
          __pyx_t_9 = -1;
          if (__pyx_t_28 < 0) {
            __pyx_t_28 += __pyx_pybuffernd_right_indexer.diminfo[0].shape;
            if (unlikely(__pyx_t_28 < 0)) __pyx_t_9 = 0;
          } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_9 = 0;
          if (unlikely(__pyx_t_9 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_9);
            {__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_28, __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_L14;
    }
    __pyx_L14:;

    /* "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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); 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_t_6 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_1 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__pyx_t_6) {
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_left_sorter));
  PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_5, ((PyObject *)__pyx_v_left_sorter));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left_sorter));
  __Pyx_INCREF(((PyObject *)__pyx_v_left_indexer));
  PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_5, ((PyObject *)__pyx_v_left_indexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left_indexer));
  __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 = 48; __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;

  /* "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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); 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_t_6 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_5); 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);
  if (__pyx_t_6) {
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_right_sorter));
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, ((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+__pyx_t_5, ((PyObject *)__pyx_v_right_indexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right_indexer));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __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_1); __pyx_t_1 = 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_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __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);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 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_6);
  { 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_79left_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_79left_outer_join = {"left_outer_join", (PyCFunction)__pyx_pw_6pandas_5algos_79left_outer_join, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_79left_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_78left_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_78left_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;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  __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;
  Py_ssize_t __pyx_t_5;
  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;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  long __pyx_t_19;
  long __pyx_t_20;
  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;
  PyObject *__pyx_t_33 = NULL;
  PyObject *__pyx_t_34 = NULL;
  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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); 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 = PyInt_FromSsize_t(__pyx_v_max_groups); 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_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4) {
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_left));
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_left));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left));
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); 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_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 62; __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_6 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_6);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); 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_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_1); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_6 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = 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_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __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_2);
  __pyx_t_2 = 0;
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.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_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_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __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_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_left_count = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 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_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_max_groups); 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_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_5); 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);
  if (__pyx_t_3) {
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_right));
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, ((PyObject *)__pyx_v_right));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right));
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, 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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_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[3]; __pyx_lineno = 63; __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[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_2 = PyObject_GetIter(__pyx_t_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);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = 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_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __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_6);
  __pyx_t_6 = 0;
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_right_count = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 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_5 = (__pyx_v_max_groups + 1);
  for (__pyx_t_13 = 1; __pyx_t_13 < __pyx_t_5; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "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_14 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_pybuffernd_right_count.diminfo[0].shape;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_right_count.diminfo[0].strides)) > 0) != 0);
    if (__pyx_t_15) {

      /* "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_16 = __pyx_v_i;
      __pyx_t_9 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_left_count.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_9 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_right_count.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__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_16, __pyx_pybuffernd_left_count.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_17, __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_18 = __pyx_v_i;
      __pyx_t_9 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_pybuffernd_left_count.diminfo[0].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__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_18, __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_19 = 0;
  __pyx_t_9 = -1;
  if (__pyx_t_19 < 0) {
    __pyx_t_19 += __pyx_pybuffernd_left_count.diminfo[0].shape;
    if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    {__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_19, __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_20 = 0;
  __pyx_t_9 = -1;
  if (__pyx_t_20 < 0) {
    __pyx_t_20 += __pyx_pybuffernd_right_count.diminfo[0].shape;
    if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    {__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_20, __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_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); 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_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_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); 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);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_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);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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[3]; __pyx_lineno = 81; __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_9 = __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_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      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_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __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_9 < 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_3);
  __pyx_t_3 = 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __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_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_count); 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);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_3); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 82; __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_9 = __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_9 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__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_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_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_9 < 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_2);
  __pyx_t_2 = 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_5 = (__pyx_v_max_groups + 1);
  for (__pyx_t_13 = 1; __pyx_t_13 < __pyx_t_5; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "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_9 = -1;
    if (__pyx_t_22 < 0) {
      __pyx_t_22 += __pyx_pybuffernd_left_count.diminfo[0].shape;
      if (unlikely(__pyx_t_22 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__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_9 = -1;
    if (__pyx_t_23 < 0) {
      __pyx_t_23 += __pyx_pybuffernd_right_count.diminfo[0].shape;
      if (unlikely(__pyx_t_23 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__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_15 = ((__pyx_v_rc == 0) != 0);
    if (__pyx_t_15) {

      /* "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_9 = -1;
        if (__pyx_t_26 < 0) {
          __pyx_t_26 += __pyx_pybuffernd_left_indexer.diminfo[0].shape;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_9 = 0;
        } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_9 = 0;
        if (unlikely(__pyx_t_9 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_9);
          {__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_9 = -1;
        if (__pyx_t_27 < 0) {
          __pyx_t_27 += __pyx_pybuffernd_right_indexer.diminfo[0].shape;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_9 = 0;
        } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_9 = 0;
        if (unlikely(__pyx_t_9 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_9);
          {__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_9 = -1;
          if (__pyx_t_30 < 0) {
            __pyx_t_30 += __pyx_pybuffernd_left_indexer.diminfo[0].shape;
            if (unlikely(__pyx_t_30 < 0)) __pyx_t_9 = 0;
          } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_9 = 0;
          if (unlikely(__pyx_t_9 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_9);
            {__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_9 = -1;
          if (__pyx_t_31 < 0) {
            __pyx_t_31 += __pyx_pybuffernd_right_indexer.diminfo[0].shape;
            if (unlikely(__pyx_t_31 < 0)) __pyx_t_9 = 0;
          } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_9 = 0;
          if (unlikely(__pyx_t_9 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_9);
            {__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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); 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_t_6 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_1 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__pyx_t_6) {
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_left_sorter));
  PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_5, ((PyObject *)__pyx_v_left_sorter));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left_sorter));
  __Pyx_INCREF(((PyObject *)__pyx_v_left_indexer));
  PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_5, ((PyObject *)__pyx_v_left_indexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left_indexer));
  __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 = 103; __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[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer);
    __pyx_t_9 = __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_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      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_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __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_9 < 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_2));
  __pyx_t_2 = 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:  # if not asked to sort, revert to original order
 */
  __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_1 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_1) {
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_right_sorter));
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_right_sorter));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right_sorter));
  __Pyx_INCREF(((PyObject *)__pyx_v_right_indexer));
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_right_indexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right_indexer));
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __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_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 = 104; __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_9 = __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_9 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__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_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_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_9 < 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_2));
  __pyx_t_2 = 0;

  /* "pandas/src/join.pyx":106
 *     right_indexer = _get_result_indexer(right_sorter, right_indexer)
 * 
 *     if not sort:  # if not asked to sort, revert to original order             # <<<<<<<<<<<<<<
 *         if len(left) == len(left_indexer):
 *             # no multiple matches for any row on the left
 */
  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_sort); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_32 = ((!__pyx_t_15) != 0);
  if (__pyx_t_32) {

    /* "pandas/src/join.pyx":107
 * 
 *     if not sort:  # if not asked to sort, revert to original order
 *         if len(left) == len(left_indexer):             # <<<<<<<<<<<<<<
 *             # no multiple matches for any row on the left
 *             # this is a short-cut to avoid groupsort_indexer
 */
    __pyx_t_5 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_left_indexer)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_32 = ((__pyx_t_5 == __pyx_t_13) != 0);
    if (__pyx_t_32) {

      /* "pandas/src/join.pyx":111
 *             # this is a short-cut to avoid groupsort_indexer
 *             # otherwise, the `else` path also works in this case
 *             if left_sorter.dtype != np.int_:             # <<<<<<<<<<<<<<
 *                 left_sorter = left_sorter.astype(np.int_)
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_sorter), __pyx_n_s_dtype); 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __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_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __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_32 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_32 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_32) {

        /* "pandas/src/join.pyx":112
 *             # otherwise, the `else` path also works in this case
 *             if left_sorter.dtype != np.int_:
 *                 left_sorter = left_sorter.astype(np.int_)             # <<<<<<<<<<<<<<
 * 
 *             rev = np.empty(len(left), dtype=np.int_)
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_sorter), __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_2) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 112; __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 = NULL;
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF_SET(__pyx_v_left_sorter, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;
        goto __pyx_L21;
      }
      __pyx_L21:;

      /* "pandas/src/join.pyx":114
 *                 left_sorter = left_sorter.astype(np.int_)
 * 
 *             rev = np.empty(len(left), dtype=np.int_)             # <<<<<<<<<<<<<<
 *             rev.put(left_sorter, np.arange(len(left)))
 *         else:
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_13); 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_t_4 = PyTuple_New(1); 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);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_3); 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_DECREF(__pyx_t_6); __pyx_t_6 = 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[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_rev = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "pandas/src/join.pyx":115
 * 
 *             rev = np.empty(len(left), dtype=np.int_)
 *             rev.put(left_sorter, np.arange(len(left)))             # <<<<<<<<<<<<<<
 *         else:
 *             rev, _ = groupsort_indexer(left_indexer, len(left))
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rev), __pyx_n_s_put); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_arange); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_33 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_33 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_33)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_33);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_33) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        __pyx_t_34 = PyTuple_New(1+1); if (unlikely(!__pyx_t_34)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_34);
        PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_33); __Pyx_GIVEREF(__pyx_t_33); __pyx_t_33 = NULL;
        PyTuple_SET_ITEM(__pyx_t_34, 0+1, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_34, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      __pyx_t_13 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_13 = 1;
        }
      }
      __pyx_t_34 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_34)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_34);
      if (__pyx_t_1) {
        PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_left_sorter));
      PyTuple_SET_ITEM(__pyx_t_34, 0+__pyx_t_13, ((PyObject *)__pyx_v_left_sorter));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_left_sorter));
      PyTuple_SET_ITEM(__pyx_t_34, 1+__pyx_t_13, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_34, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L20;
    }
    /*else*/ {

      /* "pandas/src/join.pyx":117
 *             rev.put(left_sorter, np.arange(len(left)))
 *         else:
 *             rev, _ = groupsort_indexer(left_indexer, len(left))             # <<<<<<<<<<<<<<
 * 
 *         if rev.dtype != np.int_:
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_34 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_34)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_34);
      __pyx_t_4 = NULL;
      __pyx_t_13 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_13 = 1;
        }
      }
      __pyx_t_1 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (__pyx_t_4) {
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_left_indexer));
      PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_13, ((PyObject *)__pyx_v_left_indexer));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_left_indexer));
      PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_13, __pyx_t_34);
      __Pyx_GIVEREF(__pyx_t_34);
      __pyx_t_34 = 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 = 117; __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 = 117; __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 = 117; __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 = 117; __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_34 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_34)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_34);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_7 = Py_TYPE(__pyx_t_34)->tp_iternext;
        index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_34); if (unlikely(!__pyx_t_3)) goto __pyx_L22_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_3);
        index = 1; __pyx_t_1 = __pyx_t_7(__pyx_t_34); if (unlikely(!__pyx_t_1)) goto __pyx_L22_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_1);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_34), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_7 = NULL;
        __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
        goto __pyx_L23_unpacking_done;
        __pyx_L22_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
        __pyx_t_7 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L23_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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_rev = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_v__ = __pyx_t_1;
      __pyx_t_1 = 0;
    }
    __pyx_L20:;

    /* "pandas/src/join.pyx":119
 *             rev, _ = groupsort_indexer(left_indexer, len(left))
 * 
 *         if rev.dtype != np.int_:             # <<<<<<<<<<<<<<
 *               rev = rev.astype(np.int_)
 *         right_indexer = right_indexer.take(rev)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rev), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_32 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_32 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_32) {

      /* "pandas/src/join.pyx":120
 * 
 *         if rev.dtype != np.int_:
 *               rev = rev.astype(np.int_)             # <<<<<<<<<<<<<<
 *         right_indexer = right_indexer.take(rev)
 *         left_indexer = left_indexer.take(rev)
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rev), __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_34)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_34);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_34); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_34);
        __Pyx_GIVEREF(__pyx_t_34);
        __pyx_t_34 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __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_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF_SET(__pyx_v_rev, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      goto __pyx_L24;
    }
    __pyx_L24:;

    /* "pandas/src/join.pyx":121
 *         if rev.dtype != np.int_:
 *               rev = rev.astype(np.int_)
 *         right_indexer = right_indexer.take(rev)             # <<<<<<<<<<<<<<
 *         left_indexer = left_indexer.take(rev)
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_right_indexer), __pyx_n_s_take); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_rev)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_34 = PyTuple_New(1+1); if (unlikely(!__pyx_t_34)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_34);
      PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(((PyObject *)__pyx_v_rev));
      PyTuple_SET_ITEM(__pyx_t_34, 0+1, ((PyObject *)__pyx_v_rev));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_rev));
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_34, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_21 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer);
      __pyx_t_9 = __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_9 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        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_11); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        }
      }
      __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_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_21 = 0;
    __Pyx_DECREF_SET(__pyx_v_right_indexer, ((PyArrayObject *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "pandas/src/join.pyx":122
 *               rev = rev.astype(np.int_)
 *         right_indexer = right_indexer.take(rev)
 *         left_indexer = left_indexer.take(rev)             # <<<<<<<<<<<<<<
 * 
 *     return left_indexer, right_indexer
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_indexer), __pyx_n_s_take); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_34 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_34)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_34);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_34) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_rev)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_34); __Pyx_GIVEREF(__pyx_t_34); __pyx_t_34 = NULL;
      __Pyx_INCREF(((PyObject *)__pyx_v_rev));
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_rev));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_rev));
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 122; __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_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_21 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer);
      __pyx_t_9 = __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_9 < 0)) {
        PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__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_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_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_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_21 = 0;
    __Pyx_DECREF_SET(__pyx_v_left_indexer, ((PyArrayObject *)__pyx_t_1));
    __pyx_t_1 = 0;
    goto __pyx_L19;
  }
  __pyx_L19:;

  /* "pandas/src/join.pyx":124
 *         left_indexer = left_indexer.take(rev)
 * 
 *     return left_indexer, right_indexer             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_left_indexer));
  PyTuple_SET_ITEM(__pyx_t_1, 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_1, 1, ((PyObject *)__pyx_v_right_indexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right_indexer));
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 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_6);
  __Pyx_XDECREF(__pyx_t_33);
  __Pyx_XDECREF(__pyx_t_34);
  { 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_XDECREF(__pyx_v__);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/join.pyx":128
 * 
 * 
 * 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_81full_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_81full_outer_join = {"full_outer_join", (PyCFunction)__pyx_pw_6pandas_5algos_81full_outer_join, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_81full_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 = 128; __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 = 128; __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 = 128; __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 = 129; __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 = 128; __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 = 128; __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 = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_80full_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_80full_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;
  Py_ssize_t __pyx_t_5;
  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;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  long __pyx_t_18;
  long __pyx_t_19;
  PyArrayObject *__pyx_t_20 = NULL;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  __pyx_t_5numpy_int64_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;
  __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;
  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 = 128; __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 = 128; __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":131
 *                           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":138
 *     # 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4) {
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_left));
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_left));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left));
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; __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_2); __pyx_t_2 = 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 = 138; __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_6 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_6);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_6 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_sorter.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_left_sorter = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_left_count = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/join.pyx":139
 * 
 *     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_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_3) {
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_right));
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, ((PyObject *)__pyx_v_right));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right));
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 139; __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_6); __pyx_t_6 = 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 = 139; __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[3]; __pyx_lineno = 139; __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[3]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L6_unpacking_done:;
  }
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_sorter.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_right_sorter = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_right_count = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/join.pyx":142
 * 
 *     # 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_5 = (__pyx_v_max_groups + 1);
  for (__pyx_t_13 = 1; __pyx_t_13 < __pyx_t_5; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "pandas/src/join.pyx":143
 *     # 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_14 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_pybuffernd_left_count.diminfo[0].shape;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; __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_14, __pyx_pybuffernd_left_count.diminfo[0].strides));

    /* "pandas/src/join.pyx":144
 *     for i in range(1, max_groups + 1):
 *         lc = left_count[i]
 *         rc = right_count[i]             # <<<<<<<<<<<<<<
 * 
 *         if rc > 0 and lc > 0:
 */
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_right_count.diminfo[0].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __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_15, __pyx_pybuffernd_right_count.diminfo[0].strides));

    /* "pandas/src/join.pyx":146
 *         rc = right_count[i]
 * 
 *         if rc > 0 and lc > 0:             # <<<<<<<<<<<<<<
 *             count += lc * rc
 *         else:
 */
    __pyx_t_17 = ((__pyx_v_rc > 0) != 0);
    if (__pyx_t_17) {
    } else {
      __pyx_t_16 = __pyx_t_17;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_17 = ((__pyx_v_lc > 0) != 0);
    __pyx_t_16 = __pyx_t_17;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_16) {

      /* "pandas/src/join.pyx":147
 * 
 *         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":149
 *             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":153
 *     # 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":154
 *     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":157
 * 
 *     # exclude the NA group
 *     left_pos = left_count[0]             # <<<<<<<<<<<<<<
 *     right_pos = right_count[0]
 * 
 */
  __pyx_t_18 = 0;
  __pyx_t_9 = -1;
  if (__pyx_t_18 < 0) {
    __pyx_t_18 += __pyx_pybuffernd_left_count.diminfo[0].shape;
    if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 157; __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":158
 *     # 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_9 = -1;
  if (__pyx_t_19 < 0) {
    __pyx_t_19 += __pyx_pybuffernd_right_count.diminfo[0].shape;
    if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __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":160
 *     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 = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 160; __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 = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 160; __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_6); __pyx_t_6 = 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[3]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_20 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__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_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_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __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_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_20 = 0;
  __pyx_v_left_indexer = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/join.pyx":161
 * 
 *     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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __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_6); __pyx_t_6 = 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 = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_20 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_20 = 0;
  __pyx_v_right_indexer = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/join.pyx":163
 *     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_5 = (__pyx_v_max_groups + 1);
  for (__pyx_t_13 = 1; __pyx_t_13 < __pyx_t_5; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "pandas/src/join.pyx":164
 * 
 *     for i in range(1, max_groups + 1):
 *         lc = left_count[i]             # <<<<<<<<<<<<<<
 *         rc = right_count[i]
 * 
 */
    __pyx_t_21 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_21 < 0) {
      __pyx_t_21 += __pyx_pybuffernd_left_count.diminfo[0].shape;
      if (unlikely(__pyx_t_21 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 164; __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_21, __pyx_pybuffernd_left_count.diminfo[0].strides));

    /* "pandas/src/join.pyx":165
 *     for i in range(1, max_groups + 1):
 *         lc = left_count[i]
 *         rc = right_count[i]             # <<<<<<<<<<<<<<
 * 
 *         if rc == 0:
 */
    __pyx_t_22 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_22 < 0) {
      __pyx_t_22 += __pyx_pybuffernd_right_count.diminfo[0].shape;
      if (unlikely(__pyx_t_22 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 165; __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_22, __pyx_pybuffernd_right_count.diminfo[0].strides));

    /* "pandas/src/join.pyx":167
 *         rc = right_count[i]
 * 
 *         if rc == 0:             # <<<<<<<<<<<<<<
 *             for j in range(lc):
 *                 left_indexer[position + j] = left_pos + j
 */
    __pyx_t_16 = ((__pyx_v_rc == 0) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/join.pyx":168
 * 
 *         if rc == 0:
 *             for j in range(lc):             # <<<<<<<<<<<<<<
 *                 left_indexer[position + j] = left_pos + j
 *                 right_indexer[position + j] = -1
 */
      __pyx_t_23 = __pyx_v_lc;
      for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
        __pyx_v_j = __pyx_t_24;

        /* "pandas/src/join.pyx":169
 *         if rc == 0:
 *             for j in range(lc):
 *                 left_indexer[position + j] = left_pos + j             # <<<<<<<<<<<<<<
 *                 right_indexer[position + j] = -1
 *             position += lc
 */
        __pyx_t_25 = (__pyx_v_position + __pyx_v_j);
        __pyx_t_9 = -1;
        if (__pyx_t_25 < 0) {
          __pyx_t_25 += __pyx_pybuffernd_left_indexer.diminfo[0].shape;
          if (unlikely(__pyx_t_25 < 0)) __pyx_t_9 = 0;
        } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_9 = 0;
        if (unlikely(__pyx_t_9 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_9);
          {__pyx_filename = __pyx_f[3]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = (__pyx_v_left_pos + __pyx_v_j);

        /* "pandas/src/join.pyx":170
 *             for j in range(lc):
 *                 left_indexer[position + j] = left_pos + j
 *                 right_indexer[position + j] = -1             # <<<<<<<<<<<<<<
 *             position += lc
 *         elif lc == 0:
 */
        __pyx_t_26 = (__pyx_v_position + __pyx_v_j);
        __pyx_t_9 = -1;
        if (__pyx_t_26 < 0) {
          __pyx_t_26 += __pyx_pybuffernd_right_indexer.diminfo[0].shape;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_9 = 0;
        } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_9 = 0;
        if (unlikely(__pyx_t_9 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_9);
          {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = -1;
      }

      /* "pandas/src/join.pyx":171
 *                 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_L14;
    }

    /* "pandas/src/join.pyx":172
 *                 right_indexer[position + j] = -1
 *             position += lc
 *         elif lc == 0:             # <<<<<<<<<<<<<<
 *             for j in range(rc):
 *                 left_indexer[position + j] = -1
 */
    __pyx_t_16 = ((__pyx_v_lc == 0) != 0);
    if (__pyx_t_16) {

      /* "pandas/src/join.pyx":173
 *             position += lc
 *         elif lc == 0:
 *             for j in range(rc):             # <<<<<<<<<<<<<<
 *                 left_indexer[position + j] = -1
 *                 right_indexer[position + j] = right_pos + j
 */
      __pyx_t_23 = __pyx_v_rc;
      for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
        __pyx_v_j = __pyx_t_24;

        /* "pandas/src/join.pyx":174
 *         elif lc == 0:
 *             for j in range(rc):
 *                 left_indexer[position + j] = -1             # <<<<<<<<<<<<<<
 *                 right_indexer[position + j] = right_pos + j
 *             position += rc
 */
        __pyx_t_27 = (__pyx_v_position + __pyx_v_j);
        __pyx_t_9 = -1;
        if (__pyx_t_27 < 0) {
          __pyx_t_27 += __pyx_pybuffernd_left_indexer.diminfo[0].shape;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_9 = 0;
        } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_9 = 0;
        if (unlikely(__pyx_t_9 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_9);
          {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = -1;

        /* "pandas/src/join.pyx":175
 *             for j in range(rc):
 *                 left_indexer[position + j] = -1
 *                 right_indexer[position + j] = right_pos + j             # <<<<<<<<<<<<<<
 *             position += rc
 *         else:
 */
        __pyx_t_28 = (__pyx_v_position + __pyx_v_j);
        __pyx_t_9 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_28 += __pyx_pybuffernd_right_indexer.diminfo[0].shape;
          if (unlikely(__pyx_t_28 < 0)) __pyx_t_9 = 0;
        } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_9 = 0;
        if (unlikely(__pyx_t_9 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_9);
          {__pyx_filename = __pyx_f[3]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = (__pyx_v_right_pos + __pyx_v_j);
      }

      /* "pandas/src/join.pyx":176
 *                 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_L14;
    }
    /*else*/ {

      /* "pandas/src/join.pyx":178
 *             position += rc
 *         else:
 *             for j in range(lc):             # <<<<<<<<<<<<<<
 *                 offset = position + j * rc
 *                 for k in range(rc):
 */
      __pyx_t_23 = __pyx_v_lc;
      for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
        __pyx_v_j = __pyx_t_24;

        /* "pandas/src/join.pyx":179
 *         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":180
 *             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_29 = __pyx_v_rc;
        for (__pyx_t_30 = 0; __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) {
          __pyx_v_k = __pyx_t_30;

          /* "pandas/src/join.pyx":181
 *                 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_31 = (__pyx_v_offset + __pyx_v_k);
          __pyx_t_9 = -1;
          if (__pyx_t_31 < 0) {
            __pyx_t_31 += __pyx_pybuffernd_left_indexer.diminfo[0].shape;
            if (unlikely(__pyx_t_31 < 0)) __pyx_t_9 = 0;
          } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_9 = 0;
          if (unlikely(__pyx_t_9 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_9);
            {__pyx_filename = __pyx_f[3]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = (__pyx_v_left_pos + __pyx_v_j);

          /* "pandas/src/join.pyx":182
 *                 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_32 = (__pyx_v_offset + __pyx_v_k);
          __pyx_t_9 = -1;
          if (__pyx_t_32 < 0) {
            __pyx_t_32 += __pyx_pybuffernd_right_indexer.diminfo[0].shape;
            if (unlikely(__pyx_t_32 < 0)) __pyx_t_9 = 0;
          } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_9 = 0;
          if (unlikely(__pyx_t_9 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_9);
            {__pyx_filename = __pyx_f[3]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = (__pyx_v_right_pos + __pyx_v_k);
        }
      }

      /* "pandas/src/join.pyx":183
 *                     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_L14:;

    /* "pandas/src/join.pyx":184
 *                     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":185
 *             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":187
 *         right_pos += rc
 * 
 *     return (_get_result_indexer(left_sorter, left_indexer),             # <<<<<<<<<<<<<<
 *             _get_result_indexer(right_sorter, right_indexer))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_1 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__pyx_t_6) {
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_left_sorter));
  PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_5, ((PyObject *)__pyx_v_left_sorter));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left_sorter));
  __Pyx_INCREF(((PyObject *)__pyx_v_left_indexer));
  PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_5, ((PyObject *)__pyx_v_left_indexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left_indexer));
  __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 = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/src/join.pyx":188
 * 
 *     return (_get_result_indexer(left_sorter, left_indexer),
 *             _get_result_indexer(right_sorter, right_indexer))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); 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_6 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_6) {
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_right_sorter));
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, ((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+__pyx_t_5, ((PyObject *)__pyx_v_right_indexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right_indexer));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/join.pyx":187
 *         right_pos += rc
 * 
 *     return (_get_result_indexer(left_sorter, left_indexer),             # <<<<<<<<<<<<<<
 *             _get_result_indexer(right_sorter, right_indexer))
 * 
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 187; __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);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/join.pyx":128
 * 
 * 
 * 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_6);
  { 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":192
 * 
 * 
 * def _get_result_indexer(sorter, indexer):             # <<<<<<<<<<<<<<
 *     if indexer.dtype != np.int_:
 *         indexer = indexer.astype(np.int_)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_83_get_result_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_83_get_result_indexer = {"_get_result_indexer", (PyCFunction)__pyx_pw_6pandas_5algos_83_get_result_indexer, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_83_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 = 192; __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 = 192; __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 = 192; __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_82_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_82_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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  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":193
 * 
 * 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 = 193; __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 = 193; __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 = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = 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 = 193; __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 = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "pandas/src/join.pyx":194
 * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_indexer, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 194; __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_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_indexer, __pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/src/join.pyx":195
 *     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_7 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((__pyx_t_7 > 0) != 0);
  if (__pyx_t_4) {

    /* "pandas/src/join.pyx":196
 *         indexer = indexer.astype(np.int_)
 *     if len(sorter) > 0:
 *         res = sorter.take(indexer)             # <<<<<<<<<<<<<<
 *         np.putmask(res, indexer == -1, -1)
 *     else:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sorter, __pyx_n_s_take); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_indexer);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_indexer);
      __Pyx_GIVEREF(__pyx_v_indexer);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_res = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pandas/src/join.pyx":197
 *     if len(sorter) > 0:
 *         res = sorter.take(indexer)
 *         np.putmask(res, indexer == -1, -1)             # <<<<<<<<<<<<<<
 *     else:
 *         # length-0 case
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_putmask); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_indexer, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    __pyx_t_1 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (__pyx_t_6) {
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_v_res);
    PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_res);
    __Pyx_GIVEREF(__pyx_v_res);
    PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_int_neg_1);
    PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_7, __pyx_int_neg_1);
    __Pyx_GIVEREF(__pyx_int_neg_1);
    __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 197; __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/join.pyx":200
 *     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 = 200; __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[3]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = PyObject_Length(__pyx_v_indexer); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 200; __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 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 200; __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 = 200; __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[3]; __pyx_lineno = 200; __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[3]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 200; __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_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_res = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "pandas/src/join.pyx":201
 *         # length-0 case
 *         res = np.empty(len(indexer), dtype=np.int64)
 *         res.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     return res
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "pandas/src/join.pyx":203
 *         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":192
 * 
 * 
 * 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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":207
 * 
 * 
 * def ffill_indexer(ndarray[int64_t] indexer):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(indexer)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_85ffill_indexer(PyObject *__pyx_self, PyObject *__pyx_v_indexer); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_85ffill_indexer = {"ffill_indexer", (PyCFunction)__pyx_pw_6pandas_5algos_85ffill_indexer, METH_O, 0};
static PyObject *__pyx_pw_6pandas_5algos_85ffill_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 = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_84ffill_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_84ffill_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 = 207; __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":209
 * 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 = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/join.pyx":213
 *         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 = 213; __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 = 213; __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 = 213; __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 = 213; __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 = 213; __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 = 213; __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 = 213; __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 = 213; __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 = 213; __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 = 213; __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 = 213; __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":214
 * 
 *     result = np.empty(n, dtype=np.int64)
 *     last_obs = -1             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_v_last_obs = -1;

  /* "pandas/src/join.pyx":216
 *     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":217
 * 
 *     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 = 217; __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":218
 *     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":219
 *         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 = 219; __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":221
 *             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 = 221; __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":222
 *         else:
 *             result[i] = val
 *             last_obs = val             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      __pyx_v_last_obs = __pyx_v_val;
    }
    __pyx_L5:;
  }

  /* "pandas/src/join.pyx":224
 *             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":207
 * 
 * 
 * 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":227
 * 
 * 
 * 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_87ffill_by_group(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_87ffill_by_group = {"ffill_by_group", (PyCFunction)__pyx_pw_6pandas_5algos_87ffill_by_group, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_87ffill_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 = 227; __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 = 227; __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 = 227; __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 = 228; __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 = 227; __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 = 227; __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 = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_86ffill_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_86ffill_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 = 227; __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 = 227; __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":230
 *                    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 = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/join.pyx":234
 *         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 = 234; __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 = 234; __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 = 234; __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 = 234; __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 = 234; __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 = 234; __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 = 234; __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 = 234; __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 = 234; __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 = 234; __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 = 234; __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":236
 *     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 = 236; __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 = 236; __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 = 236; __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 = 236; __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 = 236; __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 = 236; __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 = 236; __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 = 236; __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 = 236; __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 = 236; __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 = 236; __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":237
 * 
 *     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 = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 237; __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":239
 *     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":240
 * 
 *     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 = 240; __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":241
 *     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 = 241; __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":242
 *         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":243
 *         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 = 243; __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 = 243; __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":245
 *             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 = 245; __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":246
 *         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 = 246; __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":248
 *             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":227
 * 
 * 
 * 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":45
 * 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_89ensure_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":46
 * 
 * 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 = 46; __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 = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":47
 * 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":48
 *     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":50
 *             return arr
 *         else:
 *             return arr.astype(np.int_)             # <<<<<<<<<<<<<<
 *     else:
 *         return np.array(arr, dtype=np.int_)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); 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_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_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_6 = PyTuple_New(1+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);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); 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_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":52
 *             return arr.astype(np.int_)
 *     else:
 *         return np.array(arr, dtype=np.int_)             # <<<<<<<<<<<<<<
 * 
 * cpdef ensure_object(object arr):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __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 = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_arr);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr);
    __Pyx_GIVEREF(__pyx_v_arr);
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __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[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":45
 * 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_89ensure_platform_int(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_89ensure_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_88ensure_platform_int(__pyx_self, ((PyObject *)__pyx_v_arr));

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

static PyObject *__pyx_pf_6pandas_5algos_88ensure_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 = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* 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
 *         return np.array(arr, dtype=np.int_)
 * 
 * cpdef ensure_object(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_OBJECT:
 */

static PyObject *__pyx_pw_6pandas_5algos_91ensure_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_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ensure_object", 0);

  /* "pandas/src/generated.pyx":55
 * 
 * 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 = 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_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":57
 *     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":59
 *             return arr
 *         else:
 *             return arr.astype(np.object_)             # <<<<<<<<<<<<<<
 *     elif hasattr(arr,'asobject'):
 *         return arr.asobject
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); 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_GetModuleGlobalName(__pyx_n_s_np); 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_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 = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); 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_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }

  /* "pandas/src/generated.pyx":60
 *         else:
 *             return arr.astype(np.object_)
 *     elif hasattr(arr,'asobject'):             # <<<<<<<<<<<<<<
 *         return arr.asobject
 *     else:
 */
  __pyx_t_2 = PyObject_HasAttr(__pyx_v_arr, __pyx_n_s_asobject); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = (__pyx_t_2 != 0);
  if (__pyx_t_7) {

    /* "pandas/src/generated.pyx":61
 *             return arr.astype(np.object_)
 *     elif hasattr(arr,'asobject'):
 *         return arr.asobject             # <<<<<<<<<<<<<<
 *     else:
 *         return np.array(arr, dtype=np.object_)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_asobject); 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_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":63
 *         return arr.asobject
 *     else:
 *         return np.array(arr, dtype=np.object_)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; __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 = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_arr);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr);
    __Pyx_GIVEREF(__pyx_v_arr);
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; __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[2]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":54
 *         return np.array(arr, dtype=np.int_)
 * 
 * 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_91ensure_object(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_91ensure_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_90ensure_object(__pyx_self, ((PyObject *)__pyx_v_arr));

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

static PyObject *__pyx_pf_6pandas_5algos_90ensure_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 = 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_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":67
 * 
 * 
 * cpdef ensure_float64(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_FLOAT64:
 */

static PyObject *__pyx_pw_6pandas_5algos_93ensure_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":68
 * 
 * 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 = 68; __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 = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":69
 * 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":70
 *     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":72
 *             return arr
 *         else:
 *             return arr.astype(np.float64)             # <<<<<<<<<<<<<<
 *     else:
 *         return np.array(arr, dtype=np.float64)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __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_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":74
 *             return arr.astype(np.float64)
 *     else:
 *         return np.array(arr, dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); 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_INCREF(__pyx_v_arr);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr);
    __Pyx_GIVEREF(__pyx_v_arr);
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __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[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":67
 * 
 * 
 * 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_93ensure_float64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_93ensure_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_92ensure_float64(__pyx_self, ((PyObject *)__pyx_v_arr));

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

static PyObject *__pyx_pf_6pandas_5algos_92ensure_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 = 67; __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":77
 * 
 * 
 * cpdef ensure_float32(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_FLOAT32:
 */

static PyObject *__pyx_pw_6pandas_5algos_95ensure_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":78
 * 
 * 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 = 78; __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 = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":79
 * 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":80
 *     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":82
 *             return arr
 *         else:
 *             return arr.astype(np.float32)             # <<<<<<<<<<<<<<
 *     else:
 *         return np.array(arr, dtype=np.float32)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __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_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":84
 *             return arr.astype(np.float32)
 *     else:
 *         return np.array(arr, dtype=np.float32)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __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 = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_arr);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr);
    __Pyx_GIVEREF(__pyx_v_arr);
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __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[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":77
 * 
 * 
 * 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_95ensure_float32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_95ensure_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_94ensure_float32(__pyx_self, ((PyObject *)__pyx_v_arr));

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

static PyObject *__pyx_pf_6pandas_5algos_94ensure_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 = 77; __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":87
 * 
 * 
 * cpdef ensure_int8(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT8:
 */

static PyObject *__pyx_pw_6pandas_5algos_97ensure_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":88
 * 
 * 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 = 88; __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 = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":89
 * 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":90
 *     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":92
 *             return arr
 *         else:
 *             return arr.astype(np.int8)             # <<<<<<<<<<<<<<
 *     else:
 *         return np.array(arr, dtype=np.int8)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __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_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":94
 *             return arr.astype(np.int8)
 *     else:
 *         return np.array(arr, dtype=np.int8)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __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 = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_arr);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr);
    __Pyx_GIVEREF(__pyx_v_arr);
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __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[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":87
 * 
 * 
 * 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_97ensure_int8(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_97ensure_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_96ensure_int8(__pyx_self, ((PyObject *)__pyx_v_arr));

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

static PyObject *__pyx_pf_6pandas_5algos_96ensure_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 = 87; __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":97
 * 
 * 
 * cpdef ensure_int16(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT16:
 */

static PyObject *__pyx_pw_6pandas_5algos_99ensure_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":98
 * 
 * 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 = 98; __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 = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":99
 * 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":100
 *     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":102
 *             return arr
 *         else:
 *             return arr.astype(np.int16)             # <<<<<<<<<<<<<<
 *     else:
 *         return np.array(arr, dtype=np.int16)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int16); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 102; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 102; __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_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":104
 *             return arr.astype(np.int16)
 *     else:
 *         return np.array(arr, dtype=np.int16)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __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 = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_arr);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr);
    __Pyx_GIVEREF(__pyx_v_arr);
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __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[2]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int16); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __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_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":97
 * 
 * 
 * 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_99ensure_int16(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_99ensure_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_98ensure_int16(__pyx_self, ((PyObject *)__pyx_v_arr));

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

static PyObject *__pyx_pf_6pandas_5algos_98ensure_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 = 97; __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":107
 * 
 * 
 * cpdef ensure_int32(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT32:
 */

static PyObject *__pyx_pw_6pandas_5algos_101ensure_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":108
 * 
 * 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 = 108; __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 = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":109
 * 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":110
 *     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":112
 *             return arr
 *         else:
 *             return arr.astype(np.int32)             # <<<<<<<<<<<<<<
 *     else:
 *         return np.array(arr, dtype=np.int32)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 112; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 112; __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_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":114
 *             return arr.astype(np.int32)
 *     else:
 *         return np.array(arr, dtype=np.int32)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_arr);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr);
    __Pyx_GIVEREF(__pyx_v_arr);
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __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[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":107
 * 
 * 
 * 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_101ensure_int32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_101ensure_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_100ensure_int32(__pyx_self, ((PyObject *)__pyx_v_arr));

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

static PyObject *__pyx_pf_6pandas_5algos_100ensure_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 = 107; __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":117
 * 
 * 
 * cpdef ensure_int64(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT64:
 */

static PyObject *__pyx_pw_6pandas_5algos_103ensure_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":118
 * 
 * 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 = 118; __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 = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":119
 * 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":120
 *     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":122
 *             return arr
 *         else:
 *             return arr.astype(np.int64)             # <<<<<<<<<<<<<<
 *     else:
 *         return np.array(arr, dtype=np.int64)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 122; __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[2]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 122; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 122; __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_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":124
 *             return arr.astype(np.int64)
 *     else:
 *         return np.array(arr, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __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 = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_arr);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr);
    __Pyx_GIVEREF(__pyx_v_arr);
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __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[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":117
 * 
 * 
 * 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_103ensure_int64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyObject *__pyx_pw_6pandas_5algos_103ensure_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_102ensure_int64(__pyx_self, ((PyObject *)__pyx_v_arr));

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

static PyObject *__pyx_pf_6pandas_5algos_102ensure_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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* 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":129
 * @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_105map_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 = 129; __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":140
 *     '''
 *     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 = 140; __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":142
 *     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 = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":144
 *     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":145
 * 
 *     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 = 145; __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 = 145; __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 = 145; __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":147
 *         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":129
 * @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_105map_indices_float64(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_6pandas_5algos_104map_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_105map_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 = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_104map_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_104map_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 = 129; __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 = 129; __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":151
 * @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_107map_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 = 151; __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":162
 *     '''
 *     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 = 162; __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":164
 *     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 = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":166
 *     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":167
 * 
 *     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 = 167; __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 = 167; __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 = 167; __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":169
 *         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":151
 * @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_107map_indices_float32(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_6pandas_5algos_106map_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_107map_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 = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_106map_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_106map_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 = 151; __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 = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* 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":173
 * @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_109map_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 = 173; __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":184
 *     '''
 *     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 = 184; __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":186
 *     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 = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":188
 *     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":189
 * 
 *     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 = 189; __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 = 189; __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":191
 *         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":173
 * @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_109map_indices_object(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_6pandas_5algos_108map_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_109map_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 = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_108map_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_108map_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 = 173; __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 = 173; __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":195
 * @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_111map_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 = 195; __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":206
 *     '''
 *     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 = 206; __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":208
 *     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 = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":210
 *     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":211
 * 
 *     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 = 211; __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 = 211; __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 = 211; __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":213
 *         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":195
 * @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_111map_indices_int32(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_6pandas_5algos_110map_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_111map_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 = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_110map_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_110map_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 = 195; __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 = 195; __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":217
 * @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_113map_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 = 217; __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":228
 *     '''
 *     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 = 228; __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":230
 *     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 = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":232
 *     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":233
 * 
 *     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 = 233; __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 = 233; __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 = 233; __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":235
 *         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":217
 * @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_113map_indices_int64(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_6pandas_5algos_112map_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_113map_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 = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_112map_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_112map_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 = 217; __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 = 217; __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":239
 * @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_115map_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 = 239; __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":250
 *     '''
 *     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 = 250; __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":252
 *     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 = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":254
 *     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":255
 * 
 *     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 = 255; __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 = 255; __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 = 255; __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":257
 *         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":239
 * @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_115map_indices_bool(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_6pandas_5algos_114map_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_115map_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 = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_114map_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_114map_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 = 239; __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 = 239; __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":262
 * @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_117pad_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_117pad_float64 = {"pad_float64", (PyCFunction)__pyx_pw_6pandas_5algos_117pad_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_117pad_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":263
 * @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 = 262; __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 = 262; __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 = 262; __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 = 262; __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 = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_116pad_float64(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":262
 * @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_116pad_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;
  long __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;
  __pyx_t_5numpy_float64_t __pyx_t_23;
  int __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_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 = 262; __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 = 262; __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":267
 *     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":269
 *     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 = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":270
 * 
 *     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 = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":271
 *     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 = 271; __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 = 271; __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 = 271; __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 = 271; __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 = 271; __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 = 271; __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 = 271; __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 = 271; __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 = 271; __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 = 271; __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 = 271; __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":272
 *     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 = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 272; __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":274
 *     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":275
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":277
 *         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 = 277; __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 = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":278
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __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 = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":279
 *         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 = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":281
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_12 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_1 = (__pyx_v_nright - 1);
  __pyx_t_14 = 0;
  __pyx_t_12 = (((*__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_13 = __pyx_t_12;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":282
 * 
 *     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":284
 *         return indexer
 * 
 *     i = j = 0             # <<<<<<<<<<<<<<
 * 
 *     cur = old[0]
 */
  __pyx_v_i = 0;
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":286
 *     i = j = 0
 * 
 *     cur = old[0]             # <<<<<<<<<<<<<<
 * 
 *     while j <= nright - 1 and new[j] < cur:
 */
  __pyx_t_15 = 0;
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":288
 *     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) {
    } else {
      __pyx_t_13 = __pyx_t_12;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_16 = __pyx_v_j;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
    __pyx_t_13 = __pyx_t_12;
    __pyx_L11_bool_binop_done:;
    if (!__pyx_t_13) break;

    /* "pandas/src/generated.pyx":289
 * 
 *     while j <= nright - 1 and new[j] < cur:
 *         j += 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j + 1);
  }

  /* "pandas/src/generated.pyx":291
 *         j += 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j == nright:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":292
 * 
 *     while True:
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_13 = ((__pyx_v_j == __pyx_v_nright) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":293
 *     while True:
 *         if j == nright:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == nleft - 1:
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":295
 *             break
 * 
 *         if i == nleft - 1:             # <<<<<<<<<<<<<<
 *             while j < nright:
 *                 if new[j] == cur:
 */
    __pyx_t_13 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":296
 * 
 *         if i == nleft - 1:
 *             while j < nright:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0);
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":297
 *         if i == nleft - 1:
 *             while j < nright:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":298
 *             while j < nright:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":299
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_12 = (((*__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_12) {
        } else {
          __pyx_t_13 = __pyx_t_12;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
        __pyx_t_13 = __pyx_t_12;
        __pyx_L20_bool_binop_done:;
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":300
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j += 1
 */
          __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;

          /* "pandas/src/generated.pyx":301
 *                 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_L19;
        }
        __pyx_L19:;

        /* "pandas/src/generated.pyx":302
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }

      /* "pandas/src/generated.pyx":303
 *                     fill_count += 1
 *                 j += 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         next = old[i + 1]
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":305
 *             break
 * 
 *         next = old[i + 1]             # <<<<<<<<<<<<<<
 * 
 *         while j < nright and cur <= new[j] < next:
 */
    __pyx_t_21 = (__pyx_v_i + 1);
    __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":307
 *         next = old[i + 1]
 * 
 *         while j < nright and cur <= new[j] < next:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_12 = ((__pyx_v_j < __pyx_v_nright) != 0);
      if (__pyx_t_12) {
      } else {
        __pyx_t_13 = __pyx_t_12;
        goto __pyx_L24_bool_binop_done;
      }
      __pyx_t_22 = __pyx_v_j;
      __pyx_t_23 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_new.diminfo[0].strides));
      __pyx_t_12 = (__pyx_v_cur <= __pyx_t_23);
      if (__pyx_t_12) {
        __pyx_t_12 = (__pyx_t_23 < __pyx_v_next);
      }
      __pyx_t_24 = (__pyx_t_12 != 0);
      __pyx_t_13 = __pyx_t_24;
      __pyx_L24_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":308
 * 
 *         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_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":309
 *         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_L26;
      }

      /* "pandas/src/generated.pyx":310
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":311
 *                 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":312
 *             elif fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j += 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L26;
      }
      __pyx_L26:;

      /* "pandas/src/generated.pyx":313
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j += 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }

    /* "pandas/src/generated.pyx":315
 *             j += 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i += 1
 *         cur = next
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":316
 * 
 *         fill_count = 0
 *         i += 1             # <<<<<<<<<<<<<<
 *         cur = next
 * 
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "pandas/src/generated.pyx":317
 *         fill_count = 0
 *         i += 1
 *         cur = next             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_next;
  }
  __pyx_L14_break:;

  /* "pandas/src/generated.pyx":319
 *         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":262
 * @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":323
 * @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_119pad_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_119pad_float32 = {"pad_float32", (PyCFunction)__pyx_pw_6pandas_5algos_119pad_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_119pad_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":324
 * @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 = 323; __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 = 323; __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 = 323; __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 = 323; __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_118pad_float32(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":323
 * @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_118pad_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;
  long __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;
  __pyx_t_5numpy_float32_t __pyx_t_23;
  int __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_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 = 323; __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 = 323; __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":328
 *     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":330
 *     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 = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":331
 * 
 *     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 = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":332
 *     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 = 332; __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 = 332; __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 = 332; __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 = 332; __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 = 332; __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 = 332; __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 = 332; __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 = 332; __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 = 332; __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 = 332; __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 = 332; __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":333
 *     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 = 333; __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 = 333; __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":335
 *     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":336
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":338
 *         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 = 338; __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 = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":339
 *     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 = 339; __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 = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":340
 *         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 = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":342
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_12 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_1 = (__pyx_v_nright - 1);
  __pyx_t_14 = 0;
  __pyx_t_12 = (((*__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_13 = __pyx_t_12;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":343
 * 
 *     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":345
 *         return indexer
 * 
 *     i = j = 0             # <<<<<<<<<<<<<<
 * 
 *     cur = old[0]
 */
  __pyx_v_i = 0;
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":347
 *     i = j = 0
 * 
 *     cur = old[0]             # <<<<<<<<<<<<<<
 * 
 *     while j <= nright - 1 and new[j] < cur:
 */
  __pyx_t_15 = 0;
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":349
 *     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) {
    } else {
      __pyx_t_13 = __pyx_t_12;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_16 = __pyx_v_j;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
    __pyx_t_13 = __pyx_t_12;
    __pyx_L11_bool_binop_done:;
    if (!__pyx_t_13) break;

    /* "pandas/src/generated.pyx":350
 * 
 *     while j <= nright - 1 and new[j] < cur:
 *         j += 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j + 1);
  }

  /* "pandas/src/generated.pyx":352
 *         j += 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j == nright:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":353
 * 
 *     while True:
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_13 = ((__pyx_v_j == __pyx_v_nright) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":354
 *     while True:
 *         if j == nright:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == nleft - 1:
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":356
 *             break
 * 
 *         if i == nleft - 1:             # <<<<<<<<<<<<<<
 *             while j < nright:
 *                 if new[j] == cur:
 */
    __pyx_t_13 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":357
 * 
 *         if i == nleft - 1:
 *             while j < nright:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0);
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":358
 *         if i == nleft - 1:
 *             while j < nright:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":359
 *             while j < nright:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":360
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_12 = (((*__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_12) {
        } else {
          __pyx_t_13 = __pyx_t_12;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
        __pyx_t_13 = __pyx_t_12;
        __pyx_L20_bool_binop_done:;
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":361
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j += 1
 */
          __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;

          /* "pandas/src/generated.pyx":362
 *                 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_L19;
        }
        __pyx_L19:;

        /* "pandas/src/generated.pyx":363
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }

      /* "pandas/src/generated.pyx":364
 *                     fill_count += 1
 *                 j += 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         next = old[i + 1]
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":366
 *             break
 * 
 *         next = old[i + 1]             # <<<<<<<<<<<<<<
 * 
 *         while j < nright and cur <= new[j] < next:
 */
    __pyx_t_21 = (__pyx_v_i + 1);
    __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":368
 *         next = old[i + 1]
 * 
 *         while j < nright and cur <= new[j] < next:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_12 = ((__pyx_v_j < __pyx_v_nright) != 0);
      if (__pyx_t_12) {
      } else {
        __pyx_t_13 = __pyx_t_12;
        goto __pyx_L24_bool_binop_done;
      }
      __pyx_t_22 = __pyx_v_j;
      __pyx_t_23 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_new.diminfo[0].strides));
      __pyx_t_12 = (__pyx_v_cur <= __pyx_t_23);
      if (__pyx_t_12) {
        __pyx_t_12 = (__pyx_t_23 < __pyx_v_next);
      }
      __pyx_t_24 = (__pyx_t_12 != 0);
      __pyx_t_13 = __pyx_t_24;
      __pyx_L24_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":369
 * 
 *         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_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":370
 *         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_L26;
      }

      /* "pandas/src/generated.pyx":371
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":372
 *                 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":373
 *             elif fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j += 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L26;
      }
      __pyx_L26:;

      /* "pandas/src/generated.pyx":374
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j += 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }

    /* "pandas/src/generated.pyx":376
 *             j += 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i += 1
 *         cur = next
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":377
 * 
 *         fill_count = 0
 *         i += 1             # <<<<<<<<<<<<<<
 *         cur = next
 * 
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "pandas/src/generated.pyx":378
 *         fill_count = 0
 *         i += 1
 *         cur = next             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_next;
  }
  __pyx_L14_break:;

  /* "pandas/src/generated.pyx":380
 *         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":323
 * @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":384
 * @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_121pad_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_121pad_object = {"pad_object", (PyCFunction)__pyx_pw_6pandas_5algos_121pad_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_121pad_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":385
 * @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 = 384; __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 = 384; __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 = 384; __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 = 384; __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 = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_120pad_object(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":384
 * @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_120pad_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;
  long __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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 = 384; __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 = 384; __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":389
 *     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":391
 *     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 = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":392
 * 
 *     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 = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":393
 *     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 = 393; __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 = 393; __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 = 393; __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 = 393; __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 = 393; __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 = 393; __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 = 393; __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 = 393; __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 = 393; __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 = 393; __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 = 393; __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":394
 *     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 = 394; __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 = 394; __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":396
 *     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":397
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":399
 *         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 = 399; __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 = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":400
 *     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 = 400; __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 = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":401
 *         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 = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":403
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_12 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __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 = 403; __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_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_13 = __pyx_t_12;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":404
 * 
 *     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":406
 *         return indexer
 * 
 *     i = j = 0             # <<<<<<<<<<<<<<
 * 
 *     cur = old[0]
 */
  __pyx_v_i = 0;
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":408
 *     i = j = 0
 * 
 *     cur = old[0]             # <<<<<<<<<<<<<<
 * 
 *     while j <= nright - 1 and new[j] < cur:
 */
  __pyx_t_15 = 0;
  __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_15, __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":410
 *     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) {
    } else {
      __pyx_t_13 = __pyx_t_12;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_16 = __pyx_v_j;
    __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_16, __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 = 410; __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 = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = __pyx_t_12;
    __pyx_L11_bool_binop_done:;
    if (!__pyx_t_13) break;

    /* "pandas/src/generated.pyx":411
 * 
 *     while j <= nright - 1 and new[j] < cur:
 *         j += 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j + 1);
  }

  /* "pandas/src/generated.pyx":413
 *         j += 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j == nright:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":414
 * 
 *     while True:
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_13 = ((__pyx_v_j == __pyx_v_nright) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":415
 *     while True:
 *         if j == nright:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == nleft - 1:
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":417
 *             break
 * 
 *         if i == nleft - 1:             # <<<<<<<<<<<<<<
 *             while j < nright:
 *                 if new[j] == cur:
 */
    __pyx_t_13 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":418
 * 
 *         if i == nleft - 1:
 *             while j < nright:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0);
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":419
 *         if i == nleft - 1:
 *             while j < nright:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_17, __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 = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":420
 *             while j < nright:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":421
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __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 = 421; __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 = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_12) {
        } else {
          __pyx_t_13 = __pyx_t_12;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
        __pyx_t_13 = __pyx_t_12;
        __pyx_L20_bool_binop_done:;
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":422
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j += 1
 */
          __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;

          /* "pandas/src/generated.pyx":423
 *                 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_L19;
        }
        __pyx_L19:;

        /* "pandas/src/generated.pyx":424
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }

      /* "pandas/src/generated.pyx":425
 *                     fill_count += 1
 *                 j += 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         next = old[i + 1]
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":427
 *             break
 * 
 *         next = old[i + 1]             # <<<<<<<<<<<<<<
 * 
 *         while j < nright and cur <= new[j] < next:
 */
    __pyx_t_21 = (__pyx_v_i + 1);
    __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_21, __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":429
 *         next = old[i + 1]
 * 
 *         while j < nright and cur <= new[j] < next:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_12 = ((__pyx_v_j < __pyx_v_nright) != 0);
      if (__pyx_t_12) {
      } else {
        __pyx_t_13 = __pyx_t_12;
        goto __pyx_L24_bool_binop_done;
      }
      __pyx_t_22 = __pyx_v_j;
      __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_22, __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 = 429; __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 = 429; __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 = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_13 = __pyx_t_12;
      __pyx_L24_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":430
 * 
 *         while j < nright and cur <= new[j] < next:
 *             if new[j] == cur:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *             elif fill_count < lim:
 */
      __pyx_t_23 = __pyx_v_j;
      __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_23, __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 = 430; __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 = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":431
 *         while j < nright and cur <= new[j] < next:
 *             if new[j] == cur:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *             elif fill_count < lim:
 *                 indexer[j] = i
 */
        __pyx_t_24 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
        goto __pyx_L26;
      }

      /* "pandas/src/generated.pyx":432
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":433
 *                 indexer[j] = i
 *             elif fill_count < lim:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *             j += 1
 */
        __pyx_t_25 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":434
 *             elif fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j += 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L26;
      }
      __pyx_L26:;

      /* "pandas/src/generated.pyx":435
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j += 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }

    /* "pandas/src/generated.pyx":437
 *             j += 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i += 1
 *         cur = next
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":438
 * 
 *         fill_count = 0
 *         i += 1             # <<<<<<<<<<<<<<
 *         cur = next
 * 
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "pandas/src/generated.pyx":439
 *         fill_count = 0
 *         i += 1
 *         cur = next             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __Pyx_INCREF(__pyx_v_next);
    __Pyx_DECREF_SET(__pyx_v_cur, __pyx_v_next);
  }
  __pyx_L14_break:;

  /* "pandas/src/generated.pyx":441
 *         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":384
 * @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":445
 * @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_123pad_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_123pad_int32 = {"pad_int32", (PyCFunction)__pyx_pw_6pandas_5algos_123pad_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_123pad_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":446
 * @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 = 445; __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 = 445; __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 = 445; __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 = 445; __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 = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_122pad_int32(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":445
 * @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_122pad_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;
  long __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;
  __pyx_t_5numpy_int32_t __pyx_t_23;
  int __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_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 = 445; __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 = 445; __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":450
 *     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":452
 *     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 = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":453
 * 
 *     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 = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":454
 *     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 = 454; __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 = 454; __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 = 454; __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 = 454; __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 = 454; __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 = 454; __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 = 454; __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 = 454; __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 = 454; __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 = 454; __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 = 454; __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":455
 *     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 = 455; __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 = 455; __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":457
 *     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":458
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":460
 *         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 = 460; __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 = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":461
 *     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 = 461; __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 = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":462
 *         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 = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":464
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_12 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_1 = (__pyx_v_nright - 1);
  __pyx_t_14 = 0;
  __pyx_t_12 = (((*__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_13 = __pyx_t_12;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":465
 * 
 *     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":467
 *         return indexer
 * 
 *     i = j = 0             # <<<<<<<<<<<<<<
 * 
 *     cur = old[0]
 */
  __pyx_v_i = 0;
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":469
 *     i = j = 0
 * 
 *     cur = old[0]             # <<<<<<<<<<<<<<
 * 
 *     while j <= nright - 1 and new[j] < cur:
 */
  __pyx_t_15 = 0;
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":471
 *     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) {
    } else {
      __pyx_t_13 = __pyx_t_12;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_16 = __pyx_v_j;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
    __pyx_t_13 = __pyx_t_12;
    __pyx_L11_bool_binop_done:;
    if (!__pyx_t_13) break;

    /* "pandas/src/generated.pyx":472
 * 
 *     while j <= nright - 1 and new[j] < cur:
 *         j += 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j + 1);
  }

  /* "pandas/src/generated.pyx":474
 *         j += 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j == nright:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":475
 * 
 *     while True:
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_13 = ((__pyx_v_j == __pyx_v_nright) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":476
 *     while True:
 *         if j == nright:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == nleft - 1:
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":478
 *             break
 * 
 *         if i == nleft - 1:             # <<<<<<<<<<<<<<
 *             while j < nright:
 *                 if new[j] == cur:
 */
    __pyx_t_13 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":479
 * 
 *         if i == nleft - 1:
 *             while j < nright:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0);
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":480
 *         if i == nleft - 1:
 *             while j < nright:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":481
 *             while j < nright:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":482
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_12 = (((*__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_12) {
        } else {
          __pyx_t_13 = __pyx_t_12;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
        __pyx_t_13 = __pyx_t_12;
        __pyx_L20_bool_binop_done:;
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":483
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j += 1
 */
          __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;

          /* "pandas/src/generated.pyx":484
 *                 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_L19;
        }
        __pyx_L19:;

        /* "pandas/src/generated.pyx":485
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }

      /* "pandas/src/generated.pyx":486
 *                     fill_count += 1
 *                 j += 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         next = old[i + 1]
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":488
 *             break
 * 
 *         next = old[i + 1]             # <<<<<<<<<<<<<<
 * 
 *         while j < nright and cur <= new[j] < next:
 */
    __pyx_t_21 = (__pyx_v_i + 1);
    __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":490
 *         next = old[i + 1]
 * 
 *         while j < nright and cur <= new[j] < next:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_12 = ((__pyx_v_j < __pyx_v_nright) != 0);
      if (__pyx_t_12) {
      } else {
        __pyx_t_13 = __pyx_t_12;
        goto __pyx_L24_bool_binop_done;
      }
      __pyx_t_22 = __pyx_v_j;
      __pyx_t_23 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_new.diminfo[0].strides));
      __pyx_t_12 = (__pyx_v_cur <= __pyx_t_23);
      if (__pyx_t_12) {
        __pyx_t_12 = (__pyx_t_23 < __pyx_v_next);
      }
      __pyx_t_24 = (__pyx_t_12 != 0);
      __pyx_t_13 = __pyx_t_24;
      __pyx_L24_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":491
 * 
 *         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_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":492
 *         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_L26;
      }

      /* "pandas/src/generated.pyx":493
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":494
 *                 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":495
 *             elif fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j += 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L26;
      }
      __pyx_L26:;

      /* "pandas/src/generated.pyx":496
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j += 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }

    /* "pandas/src/generated.pyx":498
 *             j += 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i += 1
 *         cur = next
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":499
 * 
 *         fill_count = 0
 *         i += 1             # <<<<<<<<<<<<<<
 *         cur = next
 * 
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "pandas/src/generated.pyx":500
 *         fill_count = 0
 *         i += 1
 *         cur = next             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_next;
  }
  __pyx_L14_break:;

  /* "pandas/src/generated.pyx":502
 *         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":445
 * @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":506
 * @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_125pad_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_125pad_int64 = {"pad_int64", (PyCFunction)__pyx_pw_6pandas_5algos_125pad_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_125pad_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":507
 * @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 = 506; __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 = 506; __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 = 506; __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 = 506; __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 = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_124pad_int64(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":506
 * @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_124pad_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;
  long __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;
  __pyx_t_5numpy_int64_t __pyx_t_23;
  int __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_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 = 506; __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 = 506; __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":511
 *     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":513
 *     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 = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":514
 * 
 *     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 = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":515
 *     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 = 515; __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 = 515; __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 = 515; __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 = 515; __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 = 515; __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 = 515; __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 = 515; __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 = 515; __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 = 515; __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 = 515; __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 = 515; __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":516
 *     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 = 516; __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 = 516; __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":518
 *     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":519
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":521
 *         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 = 521; __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 = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":522
 *     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 = 522; __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 = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":523
 *         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 = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":525
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_12 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_1 = (__pyx_v_nright - 1);
  __pyx_t_14 = 0;
  __pyx_t_12 = (((*__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_13 = __pyx_t_12;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":526
 * 
 *     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":528
 *         return indexer
 * 
 *     i = j = 0             # <<<<<<<<<<<<<<
 * 
 *     cur = old[0]
 */
  __pyx_v_i = 0;
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":530
 *     i = j = 0
 * 
 *     cur = old[0]             # <<<<<<<<<<<<<<
 * 
 *     while j <= nright - 1 and new[j] < cur:
 */
  __pyx_t_15 = 0;
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":532
 *     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) {
    } else {
      __pyx_t_13 = __pyx_t_12;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_16 = __pyx_v_j;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
    __pyx_t_13 = __pyx_t_12;
    __pyx_L11_bool_binop_done:;
    if (!__pyx_t_13) break;

    /* "pandas/src/generated.pyx":533
 * 
 *     while j <= nright - 1 and new[j] < cur:
 *         j += 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j + 1);
  }

  /* "pandas/src/generated.pyx":535
 *         j += 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j == nright:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":536
 * 
 *     while True:
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_13 = ((__pyx_v_j == __pyx_v_nright) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":537
 *     while True:
 *         if j == nright:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == nleft - 1:
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":539
 *             break
 * 
 *         if i == nleft - 1:             # <<<<<<<<<<<<<<
 *             while j < nright:
 *                 if new[j] == cur:
 */
    __pyx_t_13 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":540
 * 
 *         if i == nleft - 1:
 *             while j < nright:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0);
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":541
 *         if i == nleft - 1:
 *             while j < nright:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":542
 *             while j < nright:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":543
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_12 = (((*__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_12) {
        } else {
          __pyx_t_13 = __pyx_t_12;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
        __pyx_t_13 = __pyx_t_12;
        __pyx_L20_bool_binop_done:;
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":544
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j += 1
 */
          __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;

          /* "pandas/src/generated.pyx":545
 *                 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_L19;
        }
        __pyx_L19:;

        /* "pandas/src/generated.pyx":546
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }

      /* "pandas/src/generated.pyx":547
 *                     fill_count += 1
 *                 j += 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         next = old[i + 1]
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":549
 *             break
 * 
 *         next = old[i + 1]             # <<<<<<<<<<<<<<
 * 
 *         while j < nright and cur <= new[j] < next:
 */
    __pyx_t_21 = (__pyx_v_i + 1);
    __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":551
 *         next = old[i + 1]
 * 
 *         while j < nright and cur <= new[j] < next:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_12 = ((__pyx_v_j < __pyx_v_nright) != 0);
      if (__pyx_t_12) {
      } else {
        __pyx_t_13 = __pyx_t_12;
        goto __pyx_L24_bool_binop_done;
      }
      __pyx_t_22 = __pyx_v_j;
      __pyx_t_23 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_new.diminfo[0].strides));
      __pyx_t_12 = (__pyx_v_cur <= __pyx_t_23);
      if (__pyx_t_12) {
        __pyx_t_12 = (__pyx_t_23 < __pyx_v_next);
      }
      __pyx_t_24 = (__pyx_t_12 != 0);
      __pyx_t_13 = __pyx_t_24;
      __pyx_L24_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":552
 * 
 *         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_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":553
 *         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_L26;
      }

      /* "pandas/src/generated.pyx":554
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":555
 *                 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":556
 *             elif fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j += 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L26;
      }
      __pyx_L26:;

      /* "pandas/src/generated.pyx":557
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j += 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }

    /* "pandas/src/generated.pyx":559
 *             j += 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i += 1
 *         cur = next
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":560
 * 
 *         fill_count = 0
 *         i += 1             # <<<<<<<<<<<<<<
 *         cur = next
 * 
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "pandas/src/generated.pyx":561
 *         fill_count = 0
 *         i += 1
 *         cur = next             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_next;
  }
  __pyx_L14_break:;

  /* "pandas/src/generated.pyx":563
 *         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":506
 * @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":567
 * @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_127pad_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_127pad_bool = {"pad_bool", (PyCFunction)__pyx_pw_6pandas_5algos_127pad_bool, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_127pad_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":568
 * @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 = 567; __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 = 567; __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 = 567; __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 = 567; __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 = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_126pad_bool(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":567
 * @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_126pad_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;
  long __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;
  __pyx_t_5numpy_uint8_t __pyx_t_23;
  int __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_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 = 567; __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 = 567; __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":572
 *     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":574
 *     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 = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":575
 * 
 *     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 = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":576
 *     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 = 576; __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 = 576; __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 = 576; __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 = 576; __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 = 576; __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 = 576; __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 = 576; __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 = 576; __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 = 576; __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 = 576; __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 = 576; __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":577
 *     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 = 577; __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 = 577; __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":579
 *     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":580
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":582
 *         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 = 582; __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 = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":583
 *     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 = 583; __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 = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":584
 *         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 = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":586
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[nright - 1] < old[0]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_12 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_1 = (__pyx_v_nright - 1);
  __pyx_t_14 = 0;
  __pyx_t_12 = (((*__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_13 = __pyx_t_12;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":587
 * 
 *     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":589
 *         return indexer
 * 
 *     i = j = 0             # <<<<<<<<<<<<<<
 * 
 *     cur = old[0]
 */
  __pyx_v_i = 0;
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":591
 *     i = j = 0
 * 
 *     cur = old[0]             # <<<<<<<<<<<<<<
 * 
 *     while j <= nright - 1 and new[j] < cur:
 */
  __pyx_t_15 = 0;
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":593
 *     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) {
    } else {
      __pyx_t_13 = __pyx_t_12;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_16 = __pyx_v_j;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
    __pyx_t_13 = __pyx_t_12;
    __pyx_L11_bool_binop_done:;
    if (!__pyx_t_13) break;

    /* "pandas/src/generated.pyx":594
 * 
 *     while j <= nright - 1 and new[j] < cur:
 *         j += 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j + 1);
  }

  /* "pandas/src/generated.pyx":596
 *         j += 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j == nright:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":597
 * 
 *     while True:
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_13 = ((__pyx_v_j == __pyx_v_nright) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":598
 *     while True:
 *         if j == nright:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == nleft - 1:
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":600
 *             break
 * 
 *         if i == nleft - 1:             # <<<<<<<<<<<<<<
 *             while j < nright:
 *                 if new[j] == cur:
 */
    __pyx_t_13 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":601
 * 
 *         if i == nleft - 1:
 *             while j < nright:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0);
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":602
 *         if i == nleft - 1:
 *             while j < nright:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":603
 *             while j < nright:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":604
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_12 = (((*__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_12) {
        } else {
          __pyx_t_13 = __pyx_t_12;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
        __pyx_t_13 = __pyx_t_12;
        __pyx_L20_bool_binop_done:;
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":605
 *                     indexer[j] = i
 *                 elif new[j] > cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j += 1
 */
          __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;

          /* "pandas/src/generated.pyx":606
 *                 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_L19;
        }
        __pyx_L19:;

        /* "pandas/src/generated.pyx":607
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }

      /* "pandas/src/generated.pyx":608
 *                     fill_count += 1
 *                 j += 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         next = old[i + 1]
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":610
 *             break
 * 
 *         next = old[i + 1]             # <<<<<<<<<<<<<<
 * 
 *         while j < nright and cur <= new[j] < next:
 */
    __pyx_t_21 = (__pyx_v_i + 1);
    __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":612
 *         next = old[i + 1]
 * 
 *         while j < nright and cur <= new[j] < next:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_12 = ((__pyx_v_j < __pyx_v_nright) != 0);
      if (__pyx_t_12) {
      } else {
        __pyx_t_13 = __pyx_t_12;
        goto __pyx_L24_bool_binop_done;
      }
      __pyx_t_22 = __pyx_v_j;
      __pyx_t_23 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_new.diminfo[0].strides));
      __pyx_t_12 = (__pyx_v_cur <= __pyx_t_23);
      if (__pyx_t_12) {
        __pyx_t_12 = (__pyx_t_23 < __pyx_v_next);
      }
      __pyx_t_24 = (__pyx_t_12 != 0);
      __pyx_t_13 = __pyx_t_24;
      __pyx_L24_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":613
 * 
 *         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_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":614
 *         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_L26;
      }

      /* "pandas/src/generated.pyx":615
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":616
 *                 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":617
 *             elif fill_count < lim:
 *                 indexer[j] = i
 *                 fill_count += 1             # <<<<<<<<<<<<<<
 *             j += 1
 * 
 */
        __pyx_v_fill_count = (__pyx_v_fill_count + 1);
        goto __pyx_L26;
      }
      __pyx_L26:;

      /* "pandas/src/generated.pyx":618
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j += 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }

    /* "pandas/src/generated.pyx":620
 *             j += 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i += 1
 *         cur = next
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":621
 * 
 *         fill_count = 0
 *         i += 1             # <<<<<<<<<<<<<<
 *         cur = next
 * 
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "pandas/src/generated.pyx":622
 *         fill_count = 0
 *         i += 1
 *         cur = next             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_next;
  }
  __pyx_L14_break:;

  /* "pandas/src/generated.pyx":624
 *         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":567
 * @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":629
 * @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_129backfill_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_129backfill_float64 = {"backfill_float64", (PyCFunction)__pyx_pw_6pandas_5algos_129backfill_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_129backfill_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":630
 * @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 = 629; __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 = 629; __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 = 629; __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 = 629; __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 = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_128backfill_float64(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":629
 * @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_128backfill_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;
  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;
  __pyx_t_5numpy_float64_t __pyx_t_23;
  int __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_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 = 629; __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 = 629; __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":634
 *     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":636
 *     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 = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":637
 * 
 *     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 = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":638
 *     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 = 638; __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 = 638; __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 = 638; __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 = 638; __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 = 638; __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 = 638; __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 = 638; __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 = 638; __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 = 638; __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 = 638; __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 = 638; __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":639
 *     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 = 639; __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 = 639; __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":641
 *     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":642
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":644
 *         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 = 644; __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 = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":645
 *     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 = 645; __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 = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":646
 *         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 = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":648
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_12 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_14 = 0;
  __pyx_t_1 = (__pyx_v_nleft - 1);
  __pyx_t_12 = (((*__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_13 = __pyx_t_12;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":649
 * 
 *     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":651
 *         return indexer
 * 
 *     i = nleft - 1             # <<<<<<<<<<<<<<
 *     j = nright - 1
 * 
 */
  __pyx_v_i = (__pyx_v_nleft - 1);

  /* "pandas/src/generated.pyx":652
 * 
 *     i = nleft - 1
 *     j = nright - 1             # <<<<<<<<<<<<<<
 * 
 *     cur = old[nleft - 1]
 */
  __pyx_v_j = (__pyx_v_nright - 1);

  /* "pandas/src/generated.pyx":654
 *     j = nright - 1
 * 
 *     cur = old[nleft - 1]             # <<<<<<<<<<<<<<
 * 
 *     while j >= 0 and new[j] > cur:
 */
  __pyx_t_15 = (__pyx_v_nleft - 1);
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":656
 *     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) {
    } else {
      __pyx_t_13 = __pyx_t_12;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_16 = __pyx_v_j;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0);
    __pyx_t_13 = __pyx_t_12;
    __pyx_L11_bool_binop_done:;
    if (!__pyx_t_13) break;

    /* "pandas/src/generated.pyx":657
 * 
 *     while j >= 0 and new[j] > cur:
 *         j -= 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j - 1);
  }

  /* "pandas/src/generated.pyx":659
 *         j -= 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j < 0:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":660
 * 
 *     while True:
 *         if j < 0:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_13 = ((__pyx_v_j < 0) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":661
 *     while True:
 *         if j < 0:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == 0:
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":663
 *             break
 * 
 *         if i == 0:             # <<<<<<<<<<<<<<
 *             while j >= 0:
 *                 if new[j] == cur:
 */
    __pyx_t_13 = ((__pyx_v_i == 0) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":664
 * 
 *         if i == 0:
 *             while j >= 0:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_13 = ((__pyx_v_j >= 0) != 0);
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":665
 *         if i == 0:
 *             while j >= 0:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":666
 *             while j >= 0:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":667
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_12 = (((*__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_12) {
        } else {
          __pyx_t_13 = __pyx_t_12;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
        __pyx_t_13 = __pyx_t_12;
        __pyx_L20_bool_binop_done:;
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":668
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j -= 1
 */
          __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;

          /* "pandas/src/generated.pyx":669
 *                 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_L19;
        }
        __pyx_L19:;

        /* "pandas/src/generated.pyx":670
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j -= 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/src/generated.pyx":671
 *                     fill_count += 1
 *                 j -= 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         prev = old[i - 1]
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":673
 *             break
 * 
 *         prev = old[i - 1]             # <<<<<<<<<<<<<<
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 */
    __pyx_t_21 = (__pyx_v_i - 1);
    __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":675
 *         prev = old[i - 1]
 * 
 *         while j >= 0 and prev < new[j] <= cur:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_12 = ((__pyx_v_j >= 0) != 0);
      if (__pyx_t_12) {
      } else {
        __pyx_t_13 = __pyx_t_12;
        goto __pyx_L24_bool_binop_done;
      }
      __pyx_t_22 = __pyx_v_j;
      __pyx_t_23 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_new.diminfo[0].strides));
      __pyx_t_12 = (__pyx_v_prev < __pyx_t_23);
      if (__pyx_t_12) {
        __pyx_t_12 = (__pyx_t_23 <= __pyx_v_cur);
      }
      __pyx_t_24 = (__pyx_t_12 != 0);
      __pyx_t_13 = __pyx_t_24;
      __pyx_L24_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":676
 * 
 *         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_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":677
 *         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_L26;
      }

      /* "pandas/src/generated.pyx":678
 *             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_24 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
      if (__pyx_t_24) {
      } else {
        __pyx_t_13 = __pyx_t_24;
        goto __pyx_L27_bool_binop_done;
      }
      __pyx_t_24 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      __pyx_t_13 = __pyx_t_24;
      __pyx_L27_bool_binop_done:;
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":679
 *                 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":680
 *             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_L26;
      }
      __pyx_L26:;

      /* "pandas/src/generated.pyx":681
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j -= 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j - 1);
    }

    /* "pandas/src/generated.pyx":683
 *             j -= 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i -= 1
 *         cur = prev
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":684
 * 
 *         fill_count = 0
 *         i -= 1             # <<<<<<<<<<<<<<
 *         cur = prev
 * 
 */
    __pyx_v_i = (__pyx_v_i - 1);

    /* "pandas/src/generated.pyx":685
 *         fill_count = 0
 *         i -= 1
 *         cur = prev             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_prev;
  }
  __pyx_L14_break:;

  /* "pandas/src/generated.pyx":687
 *         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":629
 * @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":691
 * @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_131backfill_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_131backfill_float32 = {"backfill_float32", (PyCFunction)__pyx_pw_6pandas_5algos_131backfill_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_131backfill_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":692
 * @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 = 691; __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 = 691; __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 = 691; __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 = 691; __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 = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_130backfill_float32(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":691
 * @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_130backfill_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;
  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;
  __pyx_t_5numpy_float32_t __pyx_t_23;
  int __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_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 = 691; __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 = 691; __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":696
 *     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":698
 *     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 = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":699
 * 
 *     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 = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":700
 *     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 = 700; __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 = 700; __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 = 700; __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 = 700; __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 = 700; __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 = 700; __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 = 700; __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 = 700; __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 = 700; __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 = 700; __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 = 700; __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":701
 *     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 = 701; __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 = 701; __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":703
 *     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":704
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":706
 *         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 = 706; __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 = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":707
 *     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 = 707; __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 = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":708
 *         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 = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":710
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_12 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_14 = 0;
  __pyx_t_1 = (__pyx_v_nleft - 1);
  __pyx_t_12 = (((*__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_13 = __pyx_t_12;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":711
 * 
 *     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":713
 *         return indexer
 * 
 *     i = nleft - 1             # <<<<<<<<<<<<<<
 *     j = nright - 1
 * 
 */
  __pyx_v_i = (__pyx_v_nleft - 1);

  /* "pandas/src/generated.pyx":714
 * 
 *     i = nleft - 1
 *     j = nright - 1             # <<<<<<<<<<<<<<
 * 
 *     cur = old[nleft - 1]
 */
  __pyx_v_j = (__pyx_v_nright - 1);

  /* "pandas/src/generated.pyx":716
 *     j = nright - 1
 * 
 *     cur = old[nleft - 1]             # <<<<<<<<<<<<<<
 * 
 *     while j >= 0 and new[j] > cur:
 */
  __pyx_t_15 = (__pyx_v_nleft - 1);
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":718
 *     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) {
    } else {
      __pyx_t_13 = __pyx_t_12;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_16 = __pyx_v_j;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0);
    __pyx_t_13 = __pyx_t_12;
    __pyx_L11_bool_binop_done:;
    if (!__pyx_t_13) break;

    /* "pandas/src/generated.pyx":719
 * 
 *     while j >= 0 and new[j] > cur:
 *         j -= 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j - 1);
  }

  /* "pandas/src/generated.pyx":721
 *         j -= 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j < 0:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":722
 * 
 *     while True:
 *         if j < 0:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_13 = ((__pyx_v_j < 0) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":723
 *     while True:
 *         if j < 0:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == 0:
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":725
 *             break
 * 
 *         if i == 0:             # <<<<<<<<<<<<<<
 *             while j >= 0:
 *                 if new[j] == cur:
 */
    __pyx_t_13 = ((__pyx_v_i == 0) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":726
 * 
 *         if i == 0:
 *             while j >= 0:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_13 = ((__pyx_v_j >= 0) != 0);
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":727
 *         if i == 0:
 *             while j >= 0:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":728
 *             while j >= 0:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":729
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_12 = (((*__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_12) {
        } else {
          __pyx_t_13 = __pyx_t_12;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
        __pyx_t_13 = __pyx_t_12;
        __pyx_L20_bool_binop_done:;
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":730
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j -= 1
 */
          __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;

          /* "pandas/src/generated.pyx":731
 *                 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_L19;
        }
        __pyx_L19:;

        /* "pandas/src/generated.pyx":732
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j -= 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/src/generated.pyx":733
 *                     fill_count += 1
 *                 j -= 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         prev = old[i - 1]
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":735
 *             break
 * 
 *         prev = old[i - 1]             # <<<<<<<<<<<<<<
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 */
    __pyx_t_21 = (__pyx_v_i - 1);
    __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":737
 *         prev = old[i - 1]
 * 
 *         while j >= 0 and prev < new[j] <= cur:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_12 = ((__pyx_v_j >= 0) != 0);
      if (__pyx_t_12) {
      } else {
        __pyx_t_13 = __pyx_t_12;
        goto __pyx_L24_bool_binop_done;
      }
      __pyx_t_22 = __pyx_v_j;
      __pyx_t_23 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_new.diminfo[0].strides));
      __pyx_t_12 = (__pyx_v_prev < __pyx_t_23);
      if (__pyx_t_12) {
        __pyx_t_12 = (__pyx_t_23 <= __pyx_v_cur);
      }
      __pyx_t_24 = (__pyx_t_12 != 0);
      __pyx_t_13 = __pyx_t_24;
      __pyx_L24_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":738
 * 
 *         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_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":739
 *         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_L26;
      }

      /* "pandas/src/generated.pyx":740
 *             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_24 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
      if (__pyx_t_24) {
      } else {
        __pyx_t_13 = __pyx_t_24;
        goto __pyx_L27_bool_binop_done;
      }
      __pyx_t_24 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      __pyx_t_13 = __pyx_t_24;
      __pyx_L27_bool_binop_done:;
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":741
 *                 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":742
 *             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_L26;
      }
      __pyx_L26:;

      /* "pandas/src/generated.pyx":743
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j -= 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j - 1);
    }

    /* "pandas/src/generated.pyx":745
 *             j -= 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i -= 1
 *         cur = prev
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":746
 * 
 *         fill_count = 0
 *         i -= 1             # <<<<<<<<<<<<<<
 *         cur = prev
 * 
 */
    __pyx_v_i = (__pyx_v_i - 1);

    /* "pandas/src/generated.pyx":747
 *         fill_count = 0
 *         i -= 1
 *         cur = prev             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_prev;
  }
  __pyx_L14_break:;

  /* "pandas/src/generated.pyx":749
 *         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":691
 * @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":753
 * @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_133backfill_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_133backfill_object = {"backfill_object", (PyCFunction)__pyx_pw_6pandas_5algos_133backfill_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_133backfill_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":754
 * @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 = 753; __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 = 753; __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 = 753; __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 = 753; __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 = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_132backfill_object(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":753
 * @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_132backfill_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;
  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;
  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 = 753; __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 = 753; __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":758
 *     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":760
 *     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 = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":761
 * 
 *     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 = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":762
 *     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 = 762; __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 = 762; __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 = 762; __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 = 762; __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 = 762; __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 = 762; __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 = 762; __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 = 762; __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 = 762; __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 = 762; __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 = 762; __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":763
 *     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 = 763; __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 = 763; __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":765
 *     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":766
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":768
 *         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 = 768; __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 = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":769
 *     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 = 769; __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 = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":770
 *         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 = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":772
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_12 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __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 = 772; __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_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_13 = __pyx_t_12;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":773
 * 
 *     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":775
 *         return indexer
 * 
 *     i = nleft - 1             # <<<<<<<<<<<<<<
 *     j = nright - 1
 * 
 */
  __pyx_v_i = (__pyx_v_nleft - 1);

  /* "pandas/src/generated.pyx":776
 * 
 *     i = nleft - 1
 *     j = nright - 1             # <<<<<<<<<<<<<<
 * 
 *     cur = old[nleft - 1]
 */
  __pyx_v_j = (__pyx_v_nright - 1);

  /* "pandas/src/generated.pyx":778
 *     j = nright - 1
 * 
 *     cur = old[nleft - 1]             # <<<<<<<<<<<<<<
 * 
 *     while j >= 0 and new[j] > cur:
 */
  __pyx_t_15 = (__pyx_v_nleft - 1);
  __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_15, __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":780
 *     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) {
    } else {
      __pyx_t_13 = __pyx_t_12;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_16 = __pyx_v_j;
    __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_16, __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 = 780; __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 = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = __pyx_t_12;
    __pyx_L11_bool_binop_done:;
    if (!__pyx_t_13) break;

    /* "pandas/src/generated.pyx":781
 * 
 *     while j >= 0 and new[j] > cur:
 *         j -= 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j - 1);
  }

  /* "pandas/src/generated.pyx":783
 *         j -= 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j < 0:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":784
 * 
 *     while True:
 *         if j < 0:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_13 = ((__pyx_v_j < 0) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":785
 *     while True:
 *         if j < 0:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == 0:
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":787
 *             break
 * 
 *         if i == 0:             # <<<<<<<<<<<<<<
 *             while j >= 0:
 *                 if new[j] == cur:
 */
    __pyx_t_13 = ((__pyx_v_i == 0) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":788
 * 
 *         if i == 0:
 *             while j >= 0:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_13 = ((__pyx_v_j >= 0) != 0);
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":789
 *         if i == 0:
 *             while j >= 0:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_17, __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 = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":790
 *             while j >= 0:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":791
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __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 = 791; __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 = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_12) {
        } else {
          __pyx_t_13 = __pyx_t_12;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
        __pyx_t_13 = __pyx_t_12;
        __pyx_L20_bool_binop_done:;
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":792
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j -= 1
 */
          __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;

          /* "pandas/src/generated.pyx":793
 *                 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_L19;
        }
        __pyx_L19:;

        /* "pandas/src/generated.pyx":794
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j -= 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/src/generated.pyx":795
 *                     fill_count += 1
 *                 j -= 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         prev = old[i - 1]
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":797
 *             break
 * 
 *         prev = old[i - 1]             # <<<<<<<<<<<<<<
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 */
    __pyx_t_21 = (__pyx_v_i - 1);
    __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_21, __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":799
 *         prev = old[i - 1]
 * 
 *         while j >= 0 and prev < new[j] <= cur:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_12 = ((__pyx_v_j >= 0) != 0);
      if (__pyx_t_12) {
      } else {
        __pyx_t_13 = __pyx_t_12;
        goto __pyx_L24_bool_binop_done;
      }
      __pyx_t_22 = __pyx_v_j;
      __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_22, __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 = 799; __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 = 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;
      __pyx_t_13 = __pyx_t_12;
      __pyx_L24_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":800
 * 
 *         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_23 = __pyx_v_j;
      __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_23, __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 = 800; __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 = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":801
 *         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_24 = __pyx_v_j;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
        goto __pyx_L26;
      }

      /* "pandas/src/generated.pyx":802
 *             if new[j] == cur:
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                 indexer[j] = i
 *                 fill_count += 1
 */
      __pyx_t_25 = __pyx_v_j;
      __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_25, __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 = 802; __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 = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_12) {
      } else {
        __pyx_t_13 = __pyx_t_12;
        goto __pyx_L27_bool_binop_done;
      }
      __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      __pyx_t_13 = __pyx_t_12;
      __pyx_L27_bool_binop_done:;
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":803
 *                 indexer[j] = i
 *             elif new[j] < cur and fill_count < lim:
 *                 indexer[j] = i             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *             j -= 1
 */
        __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;

        /* "pandas/src/generated.pyx":804
 *             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_L26;
      }
      __pyx_L26:;

      /* "pandas/src/generated.pyx":805
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j -= 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j - 1);
    }

    /* "pandas/src/generated.pyx":807
 *             j -= 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i -= 1
 *         cur = prev
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":808
 * 
 *         fill_count = 0
 *         i -= 1             # <<<<<<<<<<<<<<
 *         cur = prev
 * 
 */
    __pyx_v_i = (__pyx_v_i - 1);

    /* "pandas/src/generated.pyx":809
 *         fill_count = 0
 *         i -= 1
 *         cur = prev             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __Pyx_INCREF(__pyx_v_prev);
    __Pyx_DECREF_SET(__pyx_v_cur, __pyx_v_prev);
  }
  __pyx_L14_break:;

  /* "pandas/src/generated.pyx":811
 *         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":753
 * @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":815
 * @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_135backfill_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_135backfill_int32 = {"backfill_int32", (PyCFunction)__pyx_pw_6pandas_5algos_135backfill_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_135backfill_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":816
 * @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 = 815; __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 = 815; __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 = 815; __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 = 815; __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 = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_134backfill_int32(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":815
 * @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_134backfill_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;
  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;
  __pyx_t_5numpy_int32_t __pyx_t_23;
  int __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_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 = 815; __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 = 815; __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":820
 *     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":822
 *     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 = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":823
 * 
 *     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 = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":824
 *     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 = 824; __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 = 824; __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 = 824; __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 = 824; __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 = 824; __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 = 824; __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 = 824; __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 = 824; __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 = 824; __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 = 824; __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 = 824; __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":825
 *     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 = 825; __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 = 825; __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":827
 *     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":828
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":830
 *         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 = 830; __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 = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":831
 *     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 = 831; __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 = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":832
 *         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 = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":834
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_12 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_14 = 0;
  __pyx_t_1 = (__pyx_v_nleft - 1);
  __pyx_t_12 = (((*__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_13 = __pyx_t_12;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":835
 * 
 *     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":837
 *         return indexer
 * 
 *     i = nleft - 1             # <<<<<<<<<<<<<<
 *     j = nright - 1
 * 
 */
  __pyx_v_i = (__pyx_v_nleft - 1);

  /* "pandas/src/generated.pyx":838
 * 
 *     i = nleft - 1
 *     j = nright - 1             # <<<<<<<<<<<<<<
 * 
 *     cur = old[nleft - 1]
 */
  __pyx_v_j = (__pyx_v_nright - 1);

  /* "pandas/src/generated.pyx":840
 *     j = nright - 1
 * 
 *     cur = old[nleft - 1]             # <<<<<<<<<<<<<<
 * 
 *     while j >= 0 and new[j] > cur:
 */
  __pyx_t_15 = (__pyx_v_nleft - 1);
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":842
 *     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) {
    } else {
      __pyx_t_13 = __pyx_t_12;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_16 = __pyx_v_j;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0);
    __pyx_t_13 = __pyx_t_12;
    __pyx_L11_bool_binop_done:;
    if (!__pyx_t_13) break;

    /* "pandas/src/generated.pyx":843
 * 
 *     while j >= 0 and new[j] > cur:
 *         j -= 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j - 1);
  }

  /* "pandas/src/generated.pyx":845
 *         j -= 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j < 0:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":846
 * 
 *     while True:
 *         if j < 0:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_13 = ((__pyx_v_j < 0) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":847
 *     while True:
 *         if j < 0:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == 0:
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":849
 *             break
 * 
 *         if i == 0:             # <<<<<<<<<<<<<<
 *             while j >= 0:
 *                 if new[j] == cur:
 */
    __pyx_t_13 = ((__pyx_v_i == 0) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":850
 * 
 *         if i == 0:
 *             while j >= 0:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_13 = ((__pyx_v_j >= 0) != 0);
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":851
 *         if i == 0:
 *             while j >= 0:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":852
 *             while j >= 0:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":853
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_12 = (((*__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_12) {
        } else {
          __pyx_t_13 = __pyx_t_12;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
        __pyx_t_13 = __pyx_t_12;
        __pyx_L20_bool_binop_done:;
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":854
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j -= 1
 */
          __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;

          /* "pandas/src/generated.pyx":855
 *                 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_L19;
        }
        __pyx_L19:;

        /* "pandas/src/generated.pyx":856
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j -= 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/src/generated.pyx":857
 *                     fill_count += 1
 *                 j -= 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         prev = old[i - 1]
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":859
 *             break
 * 
 *         prev = old[i - 1]             # <<<<<<<<<<<<<<
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 */
    __pyx_t_21 = (__pyx_v_i - 1);
    __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":861
 *         prev = old[i - 1]
 * 
 *         while j >= 0 and prev < new[j] <= cur:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_12 = ((__pyx_v_j >= 0) != 0);
      if (__pyx_t_12) {
      } else {
        __pyx_t_13 = __pyx_t_12;
        goto __pyx_L24_bool_binop_done;
      }
      __pyx_t_22 = __pyx_v_j;
      __pyx_t_23 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_new.diminfo[0].strides));
      __pyx_t_12 = (__pyx_v_prev < __pyx_t_23);
      if (__pyx_t_12) {
        __pyx_t_12 = (__pyx_t_23 <= __pyx_v_cur);
      }
      __pyx_t_24 = (__pyx_t_12 != 0);
      __pyx_t_13 = __pyx_t_24;
      __pyx_L24_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":862
 * 
 *         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_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":863
 *         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_L26;
      }

      /* "pandas/src/generated.pyx":864
 *             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_24 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
      if (__pyx_t_24) {
      } else {
        __pyx_t_13 = __pyx_t_24;
        goto __pyx_L27_bool_binop_done;
      }
      __pyx_t_24 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      __pyx_t_13 = __pyx_t_24;
      __pyx_L27_bool_binop_done:;
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":865
 *                 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":866
 *             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_L26;
      }
      __pyx_L26:;

      /* "pandas/src/generated.pyx":867
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j -= 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j - 1);
    }

    /* "pandas/src/generated.pyx":869
 *             j -= 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i -= 1
 *         cur = prev
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":870
 * 
 *         fill_count = 0
 *         i -= 1             # <<<<<<<<<<<<<<
 *         cur = prev
 * 
 */
    __pyx_v_i = (__pyx_v_i - 1);

    /* "pandas/src/generated.pyx":871
 *         fill_count = 0
 *         i -= 1
 *         cur = prev             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_prev;
  }
  __pyx_L14_break:;

  /* "pandas/src/generated.pyx":873
 *         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":815
 * @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":877
 * @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_137backfill_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_137backfill_int64 = {"backfill_int64", (PyCFunction)__pyx_pw_6pandas_5algos_137backfill_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_137backfill_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":878
 * @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 = 877; __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 = 877; __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 = 877; __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 = 877; __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 = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_136backfill_int64(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":877
 * @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_136backfill_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;
  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;
  __pyx_t_5numpy_int64_t __pyx_t_23;
  int __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_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 = 877; __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 = 877; __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":882
 *     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":884
 *     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 = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":885
 * 
 *     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 = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":886
 *     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 = 886; __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 = 886; __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 = 886; __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 = 886; __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 = 886; __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 = 886; __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 = 886; __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 = 886; __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 = 886; __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 = 886; __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 = 886; __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":887
 *     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 = 887; __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 = 887; __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":889
 *     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":890
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":892
 *         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 = 892; __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 = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":893
 *     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 = 893; __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 = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":894
 *         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 = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":896
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_12 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_14 = 0;
  __pyx_t_1 = (__pyx_v_nleft - 1);
  __pyx_t_12 = (((*__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_13 = __pyx_t_12;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":897
 * 
 *     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":899
 *         return indexer
 * 
 *     i = nleft - 1             # <<<<<<<<<<<<<<
 *     j = nright - 1
 * 
 */
  __pyx_v_i = (__pyx_v_nleft - 1);

  /* "pandas/src/generated.pyx":900
 * 
 *     i = nleft - 1
 *     j = nright - 1             # <<<<<<<<<<<<<<
 * 
 *     cur = old[nleft - 1]
 */
  __pyx_v_j = (__pyx_v_nright - 1);

  /* "pandas/src/generated.pyx":902
 *     j = nright - 1
 * 
 *     cur = old[nleft - 1]             # <<<<<<<<<<<<<<
 * 
 *     while j >= 0 and new[j] > cur:
 */
  __pyx_t_15 = (__pyx_v_nleft - 1);
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":904
 *     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) {
    } else {
      __pyx_t_13 = __pyx_t_12;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_16 = __pyx_v_j;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0);
    __pyx_t_13 = __pyx_t_12;
    __pyx_L11_bool_binop_done:;
    if (!__pyx_t_13) break;

    /* "pandas/src/generated.pyx":905
 * 
 *     while j >= 0 and new[j] > cur:
 *         j -= 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j - 1);
  }

  /* "pandas/src/generated.pyx":907
 *         j -= 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j < 0:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":908
 * 
 *     while True:
 *         if j < 0:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_13 = ((__pyx_v_j < 0) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":909
 *     while True:
 *         if j < 0:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == 0:
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":911
 *             break
 * 
 *         if i == 0:             # <<<<<<<<<<<<<<
 *             while j >= 0:
 *                 if new[j] == cur:
 */
    __pyx_t_13 = ((__pyx_v_i == 0) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":912
 * 
 *         if i == 0:
 *             while j >= 0:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_13 = ((__pyx_v_j >= 0) != 0);
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":913
 *         if i == 0:
 *             while j >= 0:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":914
 *             while j >= 0:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":915
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_12 = (((*__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_12) {
        } else {
          __pyx_t_13 = __pyx_t_12;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
        __pyx_t_13 = __pyx_t_12;
        __pyx_L20_bool_binop_done:;
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":916
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j -= 1
 */
          __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;

          /* "pandas/src/generated.pyx":917
 *                 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_L19;
        }
        __pyx_L19:;

        /* "pandas/src/generated.pyx":918
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j -= 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/src/generated.pyx":919
 *                     fill_count += 1
 *                 j -= 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         prev = old[i - 1]
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":921
 *             break
 * 
 *         prev = old[i - 1]             # <<<<<<<<<<<<<<
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 */
    __pyx_t_21 = (__pyx_v_i - 1);
    __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":923
 *         prev = old[i - 1]
 * 
 *         while j >= 0 and prev < new[j] <= cur:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_12 = ((__pyx_v_j >= 0) != 0);
      if (__pyx_t_12) {
      } else {
        __pyx_t_13 = __pyx_t_12;
        goto __pyx_L24_bool_binop_done;
      }
      __pyx_t_22 = __pyx_v_j;
      __pyx_t_23 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_new.diminfo[0].strides));
      __pyx_t_12 = (__pyx_v_prev < __pyx_t_23);
      if (__pyx_t_12) {
        __pyx_t_12 = (__pyx_t_23 <= __pyx_v_cur);
      }
      __pyx_t_24 = (__pyx_t_12 != 0);
      __pyx_t_13 = __pyx_t_24;
      __pyx_L24_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":924
 * 
 *         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_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":925
 *         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_L26;
      }

      /* "pandas/src/generated.pyx":926
 *             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_24 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
      if (__pyx_t_24) {
      } else {
        __pyx_t_13 = __pyx_t_24;
        goto __pyx_L27_bool_binop_done;
      }
      __pyx_t_24 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      __pyx_t_13 = __pyx_t_24;
      __pyx_L27_bool_binop_done:;
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":927
 *                 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":928
 *             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_L26;
      }
      __pyx_L26:;

      /* "pandas/src/generated.pyx":929
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j -= 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j - 1);
    }

    /* "pandas/src/generated.pyx":931
 *             j -= 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i -= 1
 *         cur = prev
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":932
 * 
 *         fill_count = 0
 *         i -= 1             # <<<<<<<<<<<<<<
 *         cur = prev
 * 
 */
    __pyx_v_i = (__pyx_v_i - 1);

    /* "pandas/src/generated.pyx":933
 *         fill_count = 0
 *         i -= 1
 *         cur = prev             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_prev;
  }
  __pyx_L14_break:;

  /* "pandas/src/generated.pyx":935
 *         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":877
 * @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":939
 * @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_139backfill_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_139backfill_bool = {"backfill_bool", (PyCFunction)__pyx_pw_6pandas_5algos_139backfill_bool, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_139backfill_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":940
 * @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 = 939; __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 = 939; __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 = 939; __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 = 939; __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 = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_138backfill_bool(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit);

  /* "pandas/src/generated.pyx":939
 * @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_138backfill_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;
  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;
  __pyx_t_5numpy_uint8_t __pyx_t_23;
  int __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_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 = 939; __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 = 939; __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":944
 *     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":946
 *     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 = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":947
 * 
 *     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 = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":948
 *     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 = 948; __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 = 948; __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 = 948; __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 = 948; __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 = 948; __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 = 948; __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 = 948; __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 = 948; __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 = 948; __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 = 948; __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 = 948; __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":949
 *     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 = 949; __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 = 949; __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":951
 *     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":952
 * 
 *     if limit is None:
 *         lim = nright             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_nright;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":954
 *         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 = 954; __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 = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":955
 *     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 = 955; __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 = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":956
 *         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 = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":958
 *         lim = limit
 * 
 *     if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]:             # <<<<<<<<<<<<<<
 *         return indexer
 * 
 */
  __pyx_t_12 = ((__pyx_v_nleft == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_12 = ((__pyx_v_nright == 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_13 = __pyx_t_12;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_14 = 0;
  __pyx_t_1 = (__pyx_v_nleft - 1);
  __pyx_t_12 = (((*__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_13 = __pyx_t_12;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":959
 * 
 *     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":961
 *         return indexer
 * 
 *     i = nleft - 1             # <<<<<<<<<<<<<<
 *     j = nright - 1
 * 
 */
  __pyx_v_i = (__pyx_v_nleft - 1);

  /* "pandas/src/generated.pyx":962
 * 
 *     i = nleft - 1
 *     j = nright - 1             # <<<<<<<<<<<<<<
 * 
 *     cur = old[nleft - 1]
 */
  __pyx_v_j = (__pyx_v_nright - 1);

  /* "pandas/src/generated.pyx":964
 *     j = nright - 1
 * 
 *     cur = old[nleft - 1]             # <<<<<<<<<<<<<<
 * 
 *     while j >= 0 and new[j] > cur:
 */
  __pyx_t_15 = (__pyx_v_nleft - 1);
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_old.diminfo[0].strides));

  /* "pandas/src/generated.pyx":966
 *     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) {
    } else {
      __pyx_t_13 = __pyx_t_12;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_16 = __pyx_v_j;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0);
    __pyx_t_13 = __pyx_t_12;
    __pyx_L11_bool_binop_done:;
    if (!__pyx_t_13) break;

    /* "pandas/src/generated.pyx":967
 * 
 *     while j >= 0 and new[j] > cur:
 *         j -= 1             # <<<<<<<<<<<<<<
 * 
 *     while True:
 */
    __pyx_v_j = (__pyx_v_j - 1);
  }

  /* "pandas/src/generated.pyx":969
 *         j -= 1
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         if j < 0:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":970
 * 
 *     while True:
 *         if j < 0:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_13 = ((__pyx_v_j < 0) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":971
 *     while True:
 *         if j < 0:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if i == 0:
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":973
 *             break
 * 
 *         if i == 0:             # <<<<<<<<<<<<<<
 *             while j >= 0:
 *                 if new[j] == cur:
 */
    __pyx_t_13 = ((__pyx_v_i == 0) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/generated.pyx":974
 * 
 *         if i == 0:
 *             while j >= 0:             # <<<<<<<<<<<<<<
 *                 if new[j] == cur:
 *                     indexer[j] = i
 */
      while (1) {
        __pyx_t_13 = ((__pyx_v_j >= 0) != 0);
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":975
 *         if i == 0:
 *             while j >= 0:
 *                 if new[j] == cur:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 */
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":976
 *             while j >= 0:
 *                 if new[j] == cur:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i
 */
          __pyx_t_18 = __pyx_v_j;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i;
          goto __pyx_L19;
        }

        /* "pandas/src/generated.pyx":977
 *                 if new[j] == cur:
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:             # <<<<<<<<<<<<<<
 *                     indexer[j] = i
 *                     fill_count += 1
 */
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_12 = (((*__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_12) {
        } else {
          __pyx_t_13 = __pyx_t_12;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
        __pyx_t_13 = __pyx_t_12;
        __pyx_L20_bool_binop_done:;
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":978
 *                     indexer[j] = i
 *                 elif new[j] < cur and fill_count < lim:
 *                     indexer[j] = i             # <<<<<<<<<<<<<<
 *                     fill_count += 1
 *                 j -= 1
 */
          __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;

          /* "pandas/src/generated.pyx":979
 *                 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_L19;
        }
        __pyx_L19:;

        /* "pandas/src/generated.pyx":980
 *                     indexer[j] = i
 *                     fill_count += 1
 *                 j -= 1             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "pandas/src/generated.pyx":981
 *                     fill_count += 1
 *                 j -= 1
 *             break             # <<<<<<<<<<<<<<
 * 
 *         prev = old[i - 1]
 */
      goto __pyx_L14_break;
    }

    /* "pandas/src/generated.pyx":983
 *             break
 * 
 *         prev = old[i - 1]             # <<<<<<<<<<<<<<
 * 
 *         while j >= 0 and prev < new[j] <= cur:
 */
    __pyx_t_21 = (__pyx_v_i - 1);
    __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_old.diminfo[0].strides));

    /* "pandas/src/generated.pyx":985
 *         prev = old[i - 1]
 * 
 *         while j >= 0 and prev < new[j] <= cur:             # <<<<<<<<<<<<<<
 *             if new[j] == cur:
 *                 indexer[j] = i
 */
    while (1) {
      __pyx_t_12 = ((__pyx_v_j >= 0) != 0);
      if (__pyx_t_12) {
      } else {
        __pyx_t_13 = __pyx_t_12;
        goto __pyx_L24_bool_binop_done;
      }
      __pyx_t_22 = __pyx_v_j;
      __pyx_t_23 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_new.diminfo[0].strides));
      __pyx_t_12 = (__pyx_v_prev < __pyx_t_23);
      if (__pyx_t_12) {
        __pyx_t_12 = (__pyx_t_23 <= __pyx_v_cur);
      }
      __pyx_t_24 = (__pyx_t_12 != 0);
      __pyx_t_13 = __pyx_t_24;
      __pyx_L24_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":986
 * 
 *         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_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":987
 *         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_L26;
      }

      /* "pandas/src/generated.pyx":988
 *             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_24 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0);
      if (__pyx_t_24) {
      } else {
        __pyx_t_13 = __pyx_t_24;
        goto __pyx_L27_bool_binop_done;
      }
      __pyx_t_24 = ((__pyx_v_fill_count < __pyx_v_lim) != 0);
      __pyx_t_13 = __pyx_t_24;
      __pyx_L27_bool_binop_done:;
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":989
 *                 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":990
 *             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_L26;
      }
      __pyx_L26:;

      /* "pandas/src/generated.pyx":991
 *                 indexer[j] = i
 *                 fill_count += 1
 *             j -= 1             # <<<<<<<<<<<<<<
 * 
 *         fill_count = 0
 */
      __pyx_v_j = (__pyx_v_j - 1);
    }

    /* "pandas/src/generated.pyx":993
 *             j -= 1
 * 
 *         fill_count = 0             # <<<<<<<<<<<<<<
 *         i -= 1
 *         cur = prev
 */
    __pyx_v_fill_count = 0;

    /* "pandas/src/generated.pyx":994
 * 
 *         fill_count = 0
 *         i -= 1             # <<<<<<<<<<<<<<
 *         cur = prev
 * 
 */
    __pyx_v_i = (__pyx_v_i - 1);

    /* "pandas/src/generated.pyx":995
 *         fill_count = 0
 *         i -= 1
 *         cur = prev             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    __pyx_v_cur = __pyx_v_prev;
  }
  __pyx_L14_break:;

  /* "pandas/src/generated.pyx":997
 *         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":939
 * @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":1002
 * @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_141pad_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_141pad_inplace_float64 = {"pad_inplace_float64", (PyCFunction)__pyx_pw_6pandas_5algos_141pad_inplace_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_141pad_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":1004
 * 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 = 1002; __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 = 1002; __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 = 1002; __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 = 1002; __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 = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_140pad_inplace_float64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1002
 * @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_140pad_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 = 1002; __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 = 1002; __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":1007
 *     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":1009
 *     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 = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1012
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1013
 *     # 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":1015
 *         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":1016
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1018
 *         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 = 1018; __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 = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1019
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1019; __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 = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1020
 *         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 = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1022
 *         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":1023
 * 
 *     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":1024
 *     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":1025
 *     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":1026
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1027
 *             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":1028
 *                 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":1030
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1031
 *         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":1002
 * @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":1035
 * @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_143pad_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_143pad_inplace_float32 = {"pad_inplace_float32", (PyCFunction)__pyx_pw_6pandas_5algos_143pad_inplace_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_143pad_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":1037
 * 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 = 1035; __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 = 1035; __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 = 1035; __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 = 1035; __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 = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_142pad_inplace_float32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1035
 * @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_142pad_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 = 1035; __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 = 1035; __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":1040
 *     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":1042
 *     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 = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1045
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1046
 *     # 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":1048
 *         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":1049
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1051
 *         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 = 1051; __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 = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1052
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1052; __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 = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1053
 *         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 = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1055
 *         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":1056
 * 
 *     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":1057
 *     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":1058
 *     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":1059
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1060
 *             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":1061
 *                 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":1063
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1064
 *         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":1035
 * @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":1068
 * @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_145pad_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_145pad_inplace_object = {"pad_inplace_object", (PyCFunction)__pyx_pw_6pandas_5algos_145pad_inplace_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_145pad_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":1070
 * 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 = 1068; __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 = 1068; __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 = 1068; __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 = 1068; __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 = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_144pad_inplace_object(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1068
 * @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_144pad_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 = 1068; __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 = 1068; __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":1073
 *     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":1075
 *     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 = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1078
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1079
 *     # 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":1081
 *         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":1082
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1084
 *         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 = 1084; __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 = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1085
 *     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 = 1085; __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 = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1086
 *         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 = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1088
 *         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":1089
 * 
 *     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":1090
 *     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":1091
 *     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":1092
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1093
 *             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":1094
 *                 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":1096
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1097
 *         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":1068
 * @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":1101
 * @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_147pad_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_147pad_inplace_int32 = {"pad_inplace_int32", (PyCFunction)__pyx_pw_6pandas_5algos_147pad_inplace_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_147pad_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":1103
 * 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 = 1101; __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 = 1101; __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 = 1101; __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 = 1101; __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 = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_146pad_inplace_int32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1101
 * @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_146pad_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 = 1101; __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 = 1101; __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":1106
 *     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":1108
 *     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 = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1111
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1112
 *     # 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":1114
 *         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":1115
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1117
 *         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 = 1117; __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 = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1118
 *     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 = 1118; __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 = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1119
 *         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 = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1121
 *         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":1122
 * 
 *     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":1123
 *     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":1124
 *     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":1125
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1126
 *             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":1127
 *                 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":1129
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1130
 *         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":1101
 * @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":1134
 * @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_149pad_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_149pad_inplace_int64 = {"pad_inplace_int64", (PyCFunction)__pyx_pw_6pandas_5algos_149pad_inplace_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_149pad_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":1136
 * 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 = 1134; __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 = 1134; __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 = 1134; __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 = 1134; __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 = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_148pad_inplace_int64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1134
 * @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_148pad_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 = 1134; __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 = 1134; __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":1139
 *     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":1141
 *     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 = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1144
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1145
 *     # 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":1147
 *         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":1148
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1150
 *         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 = 1150; __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 = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1151
 *     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 = 1151; __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 = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1152
 *         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 = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1154
 *         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":1155
 * 
 *     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":1156
 *     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":1157
 *     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":1158
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1159
 *             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":1160
 *                 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":1162
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1163
 *         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":1134
 * @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":1167
 * @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_151pad_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_151pad_inplace_bool = {"pad_inplace_bool", (PyCFunction)__pyx_pw_6pandas_5algos_151pad_inplace_bool, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_151pad_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":1169
 * 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 = 1167; __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 = 1167; __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 = 1167; __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 = 1167; __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 = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_150pad_inplace_bool(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1167
 * @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_150pad_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 = 1167; __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 = 1167; __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":1172
 *     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":1174
 *     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 = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1177
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1178
 *     # 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":1180
 *         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":1181
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1183
 *         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 = 1183; __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 = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1184
 *     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 = 1184; __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 = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1185
 *         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 = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1187
 *         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":1188
 * 
 *     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":1189
 *     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":1190
 *     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":1191
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1192
 *             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":1193
 *                 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":1195
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1196
 *         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":1167
 * @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":1201
 * @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_153backfill_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_153backfill_inplace_float64 = {"backfill_inplace_float64", (PyCFunction)__pyx_pw_6pandas_5algos_153backfill_inplace_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_153backfill_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":1203
 * 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 = 1201; __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 = 1201; __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 = 1201; __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 = 1201; __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 = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_152backfill_inplace_float64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1201
 * @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_152backfill_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 = 1201; __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 = 1201; __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":1206
 *     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":1208
 *     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 = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1211
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1212
 *     # 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":1214
 *         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":1215
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1217
 *         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 = 1217; __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 = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1218
 *     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 = 1218; __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 = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1219
 *         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 = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1221
 *         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":1222
 * 
 *     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":1223
 *     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":1224
 *     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":1225
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1226
 *             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":1227
 *                 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":1229
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * @cython.boundscheck(False)
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1230
 *         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":1201
 * @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":1233
 * @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_155backfill_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_155backfill_inplace_float32 = {"backfill_inplace_float32", (PyCFunction)__pyx_pw_6pandas_5algos_155backfill_inplace_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_155backfill_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":1235
 * 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 = 1233; __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 = 1233; __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 = 1233; __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 = 1233; __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 = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_154backfill_inplace_float32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1233
 * @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_154backfill_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 = 1233; __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 = 1233; __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":1238
 *     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":1240
 *     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 = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1243
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1244
 *     # 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":1246
 *         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":1247
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1249
 *         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 = 1249; __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 = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1250
 *     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 = 1250; __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 = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1251
 *         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 = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1253
 *         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":1254
 * 
 *     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":1255
 *     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":1256
 *     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":1257
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1258
 *             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":1259
 *                 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":1261
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * @cython.boundscheck(False)
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1262
 *         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":1233
 * @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":1265
 * @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_157backfill_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_157backfill_inplace_object = {"backfill_inplace_object", (PyCFunction)__pyx_pw_6pandas_5algos_157backfill_inplace_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_157backfill_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":1267
 * 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 = 1265; __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 = 1265; __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 = 1265; __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 = 1265; __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 = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_156backfill_inplace_object(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1265
 * @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_156backfill_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 = 1265; __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 = 1265; __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":1270
 *     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":1272
 *     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 = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1275
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1276
 *     # 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":1278
 *         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":1279
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1281
 *         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 = 1281; __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 = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1282
 *     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 = 1282; __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 = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1283
 *         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 = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1285
 *         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":1286
 * 
 *     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":1287
 *     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":1288
 *     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":1289
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1290
 *             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":1291
 *                 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":1293
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * @cython.boundscheck(False)
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1294
 *         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":1265
 * @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":1297
 * @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_159backfill_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_159backfill_inplace_int32 = {"backfill_inplace_int32", (PyCFunction)__pyx_pw_6pandas_5algos_159backfill_inplace_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_159backfill_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":1299
 * 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 = 1297; __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 = 1297; __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 = 1297; __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 = 1297; __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 = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_158backfill_inplace_int32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1297
 * @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_158backfill_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 = 1297; __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 = 1297; __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":1302
 *     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":1304
 *     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 = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1307
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1308
 *     # 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":1310
 *         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":1311
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1313
 *         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 = 1313; __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 = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1314
 *     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 = 1314; __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 = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1315
 *         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 = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1317
 *         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":1318
 * 
 *     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":1319
 *     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":1320
 *     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":1321
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1322
 *             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":1323
 *                 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":1325
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * @cython.boundscheck(False)
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1326
 *         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":1297
 * @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":1329
 * @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_161backfill_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_161backfill_inplace_int64 = {"backfill_inplace_int64", (PyCFunction)__pyx_pw_6pandas_5algos_161backfill_inplace_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_161backfill_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":1331
 * 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 = 1329; __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 = 1329; __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 = 1329; __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 = 1329; __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 = 1330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_160backfill_inplace_int64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1329
 * @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_160backfill_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 = 1329; __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 = 1329; __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":1334
 *     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":1336
 *     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 = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1339
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1340
 *     # 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":1342
 *         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":1343
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1345
 *         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 = 1345; __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 = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1346
 *     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 = 1346; __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 = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1347
 *         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 = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1349
 *         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":1350
 * 
 *     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":1351
 *     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":1352
 *     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":1353
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1354
 *             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":1355
 *                 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":1357
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * @cython.boundscheck(False)
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1358
 *         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":1329
 * @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":1361
 * @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_163backfill_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_163backfill_inplace_bool = {"backfill_inplace_bool", (PyCFunction)__pyx_pw_6pandas_5algos_163backfill_inplace_bool, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_163backfill_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":1363
 * 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 = 1361; __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 = 1361; __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 = 1361; __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 = 1361; __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 = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_162backfill_inplace_bool(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1361
 * @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_162backfill_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 = 1361; __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 = 1361; __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":1366
 *     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":1368
 *     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 = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "pandas/src/generated.pyx":1371
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1372
 *     # 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":1374
 *         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":1375
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1377
 *         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 = 1377; __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 = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":1378
 *     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 = 1378; __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 = 1378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1379
 *         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 = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_5;
  }
  __pyx_L4:;

  /* "pandas/src/generated.pyx":1381
 *         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":1382
 * 
 *     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":1383
 *     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":1384
 *     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":1385
 *         if mask[i]:
 *             if fill_count >= lim:
 *                 continue             # <<<<<<<<<<<<<<
 *             fill_count += 1
 *             values[i] = val
 */
        goto __pyx_L6_continue;
      }

      /* "pandas/src/generated.pyx":1386
 *             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":1387
 *                 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":1389
 *             values[i] = val
 *         else:
 *             fill_count = 0             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
      __pyx_v_fill_count = 0;

      /* "pandas/src/generated.pyx":1390
 *         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":1361
 * @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":1394
 * @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_165pad_2d_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_165pad_2d_inplace_float64 = {"pad_2d_inplace_float64", (PyCFunction)__pyx_pw_6pandas_5algos_165pad_2d_inplace_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_165pad_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":1396
 * 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 = 1394; __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 = 1394; __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 = 1394; __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 = 1394; __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 = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_164pad_2d_inplace_float64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1394
 * @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_164pad_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 = 1394; __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 = 1394; __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":1399
 *     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":1401
 *     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 = 1401; __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 = 1401; __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 = 1401; __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 = 1401; __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 = 1401; __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 = 1401; __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 = 1401; __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 = 1401; __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 = 1401; __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":1404
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1405
 *     # 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":1407
 *         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":1408
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1410
 *         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 = 1410; __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 = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1411
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1411; __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 = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1412
 *         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 = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1414
 *         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":1415
 * 
 *     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":1416
 *     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":1417
 *         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":1418
 *         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":1419
 *         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":1420
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1421
 *                 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":1422
 *                     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":1424
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1425
 *             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":1394
 * @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":1428
 * @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_167pad_2d_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_167pad_2d_inplace_float32 = {"pad_2d_inplace_float32", (PyCFunction)__pyx_pw_6pandas_5algos_167pad_2d_inplace_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_167pad_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":1430
 * 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 = 1428; __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 = 1428; __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 = 1428; __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 = 1428; __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 = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_166pad_2d_inplace_float32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1428
 * @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_166pad_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 = 1428; __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 = 1428; __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":1433
 *     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":1435
 *     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 = 1435; __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 = 1435; __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 = 1435; __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 = 1435; __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 = 1435; __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 = 1435; __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 = 1435; __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 = 1435; __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 = 1435; __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":1438
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1439
 *     # 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":1441
 *         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":1442
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1444
 *         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 = 1444; __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 = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1445
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1445; __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 = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1446
 *         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 = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1448
 *         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":1449
 * 
 *     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":1450
 *     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":1451
 *         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":1452
 *         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":1453
 *         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":1454
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1455
 *                 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":1456
 *                     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":1458
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1459
 *             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":1428
 * @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":1462
 * @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_169pad_2d_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_169pad_2d_inplace_object = {"pad_2d_inplace_object", (PyCFunction)__pyx_pw_6pandas_5algos_169pad_2d_inplace_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_169pad_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":1464
 * 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 = 1462; __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 = 1462; __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 = 1462; __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 = 1462; __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 = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_168pad_2d_inplace_object(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1462
 * @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_168pad_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 = 1462; __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 = 1462; __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":1467
 *     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":1469
 *     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 = 1469; __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 = 1469; __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 = 1469; __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 = 1469; __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 = 1469; __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 = 1469; __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 = 1469; __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 = 1469; __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 = 1469; __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":1472
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1473
 *     # 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":1475
 *         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":1476
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1478
 *         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 = 1478; __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 = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1479
 *     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 = 1479; __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 = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1480
 *         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 = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1482
 *         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":1483
 * 
 *     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":1484
 *     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":1485
 *         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":1486
 *         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":1487
 *         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":1488
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1489
 *                 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":1490
 *                     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":1492
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1493
 *             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":1462
 * @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":1496
 * @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_171pad_2d_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_171pad_2d_inplace_int32 = {"pad_2d_inplace_int32", (PyCFunction)__pyx_pw_6pandas_5algos_171pad_2d_inplace_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_171pad_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":1498
 * 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 = 1496; __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 = 1496; __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 = 1496; __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 = 1496; __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 = 1497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_170pad_2d_inplace_int32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1496
 * @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_170pad_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 = 1496; __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 = 1496; __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":1501
 *     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":1503
 *     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 = 1503; __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 = 1503; __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 = 1503; __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 = 1503; __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 = 1503; __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 = 1503; __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 = 1503; __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 = 1503; __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 = 1503; __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":1506
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1507
 *     # 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":1509
 *         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":1510
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1512
 *         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 = 1512; __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 = 1512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1513
 *     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 = 1513; __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 = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1514
 *         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 = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1516
 *         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":1517
 * 
 *     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":1518
 *     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":1519
 *         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":1520
 *         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":1521
 *         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":1522
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1523
 *                 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":1524
 *                     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":1526
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1527
 *             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":1496
 * @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":1530
 * @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_173pad_2d_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_173pad_2d_inplace_int64 = {"pad_2d_inplace_int64", (PyCFunction)__pyx_pw_6pandas_5algos_173pad_2d_inplace_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_173pad_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":1532
 * 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 = 1530; __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 = 1530; __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 = 1530; __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 = 1530; __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 = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_172pad_2d_inplace_int64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1530
 * @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_172pad_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 = 1530; __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 = 1530; __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":1535
 *     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":1537
 *     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 = 1537; __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 = 1537; __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 = 1537; __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 = 1537; __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 = 1537; __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 = 1537; __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 = 1537; __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 = 1537; __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 = 1537; __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":1540
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1541
 *     # 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":1543
 *         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":1544
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1546
 *         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 = 1546; __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 = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1547
 *     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 = 1547; __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 = 1547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1548
 *         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 = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1550
 *         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":1551
 * 
 *     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":1552
 *     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":1553
 *         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":1554
 *         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":1555
 *         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":1556
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1557
 *                 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":1558
 *                     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":1560
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1561
 *             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":1530
 * @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":1564
 * @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_175pad_2d_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_175pad_2d_inplace_bool = {"pad_2d_inplace_bool", (PyCFunction)__pyx_pw_6pandas_5algos_175pad_2d_inplace_bool, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_175pad_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":1566
 * 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 = 1564; __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 = 1564; __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 = 1564; __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 = 1564; __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 = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_174pad_2d_inplace_bool(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1564
 * @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_174pad_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 = 1564; __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 = 1564; __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":1569
 *     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":1571
 *     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 = 1571; __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 = 1571; __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 = 1571; __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 = 1571; __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 = 1571; __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 = 1571; __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 = 1571; __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 = 1571; __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 = 1571; __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":1574
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1575
 *     # 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":1577
 *         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":1578
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1580
 *         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 = 1580; __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 = 1580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1581
 *     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 = 1581; __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 = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1582
 *         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 = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1584
 *         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":1585
 * 
 *     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":1586
 *     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":1587
 *         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":1588
 *         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":1589
 *         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":1590
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1591
 *                 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":1592
 *                     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":1594
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * 
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1595
 *             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":1564
 * @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":1599
 * @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_177backfill_2d_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_177backfill_2d_inplace_float64 = {"backfill_2d_inplace_float64", (PyCFunction)__pyx_pw_6pandas_5algos_177backfill_2d_inplace_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_177backfill_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":1601
 * 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 = 1599; __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 = 1599; __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 = 1599; __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 = 1599; __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 = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_176backfill_2d_inplace_float64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1599
 * @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_176backfill_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 = 1599; __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 = 1599; __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":1604
 *     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":1606
 *     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 = 1606; __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 = 1606; __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 = 1606; __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 = 1606; __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 = 1606; __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 = 1606; __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 = 1606; __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 = 1606; __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 = 1606; __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":1609
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1610
 *     # 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":1612
 *         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":1613
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1615
 *         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 = 1615; __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 = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1616
 *     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 = 1616; __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 = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1617
 *         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 = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1619
 *         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":1620
 * 
 *     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":1621
 *     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":1622
 *         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":1623
 *         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":1624
 *         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":1625
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1626
 *                 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":1627
 *                     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":1629
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1630
 *             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":1599
 * @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":1633
 * @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_179backfill_2d_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_179backfill_2d_inplace_float32 = {"backfill_2d_inplace_float32", (PyCFunction)__pyx_pw_6pandas_5algos_179backfill_2d_inplace_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_179backfill_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":1635
 * 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 = 1633; __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 = 1633; __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 = 1633; __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 = 1633; __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 = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_178backfill_2d_inplace_float32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1633
 * @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_178backfill_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 = 1633; __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 = 1633; __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":1638
 *     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":1640
 *     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 = 1640; __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 = 1640; __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 = 1640; __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 = 1640; __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 = 1640; __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 = 1640; __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 = 1640; __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 = 1640; __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 = 1640; __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":1643
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1644
 *     # 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":1646
 *         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":1647
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1649
 *         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 = 1649; __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 = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1650
 *     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 = 1650; __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 = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1651
 *         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 = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1653
 *         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":1654
 * 
 *     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":1655
 *     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":1656
 *         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":1657
 *         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":1658
 *         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":1659
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1660
 *                 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":1661
 *                     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":1663
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1664
 *             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":1633
 * @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":1667
 * @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_181backfill_2d_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_181backfill_2d_inplace_object = {"backfill_2d_inplace_object", (PyCFunction)__pyx_pw_6pandas_5algos_181backfill_2d_inplace_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_181backfill_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":1669
 * 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 = 1667; __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 = 1667; __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 = 1667; __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 = 1667; __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 = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_180backfill_2d_inplace_object(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1667
 * @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_180backfill_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 = 1667; __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 = 1667; __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":1672
 *     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":1674
 *     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 = 1674; __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 = 1674; __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 = 1674; __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 = 1674; __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 = 1674; __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 = 1674; __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 = 1674; __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 = 1674; __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 = 1674; __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":1677
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1678
 *     # 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":1680
 *         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":1681
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1683
 *         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 = 1683; __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 = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1684
 *     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 = 1684; __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 = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1685
 *         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 = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1687
 *         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":1688
 * 
 *     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":1689
 *     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":1690
 *         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":1691
 *         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":1692
 *         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":1693
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1694
 *                 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":1695
 *                     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":1697
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1698
 *             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":1667
 * @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":1701
 * @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_183backfill_2d_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_183backfill_2d_inplace_int32 = {"backfill_2d_inplace_int32", (PyCFunction)__pyx_pw_6pandas_5algos_183backfill_2d_inplace_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_183backfill_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":1703
 * 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 = 1701; __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 = 1701; __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 = 1701; __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 = 1701; __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 = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_182backfill_2d_inplace_int32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1701
 * @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_182backfill_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 = 1701; __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 = 1701; __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":1706
 *     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":1708
 *     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 = 1708; __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 = 1708; __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 = 1708; __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 = 1708; __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 = 1708; __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 = 1708; __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 = 1708; __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 = 1708; __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 = 1708; __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":1711
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1712
 *     # 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":1714
 *         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":1715
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1717
 *         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 = 1717; __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 = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1718
 *     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 = 1718; __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 = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1719
 *         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 = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1721
 *         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":1722
 * 
 *     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":1723
 *     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":1724
 *         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":1725
 *         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":1726
 *         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":1727
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1728
 *                 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":1729
 *                     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":1731
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1732
 *             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":1701
 * @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":1735
 * @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_185backfill_2d_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_185backfill_2d_inplace_int64 = {"backfill_2d_inplace_int64", (PyCFunction)__pyx_pw_6pandas_5algos_185backfill_2d_inplace_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_185backfill_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":1737
 * 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 = 1735; __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 = 1735; __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 = 1735; __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 = 1735; __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 = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_184backfill_2d_inplace_int64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1735
 * @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_184backfill_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 = 1735; __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 = 1735; __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":1740
 *     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":1742
 *     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 = 1742; __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 = 1742; __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 = 1742; __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 = 1742; __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 = 1742; __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 = 1742; __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 = 1742; __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 = 1742; __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 = 1742; __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":1745
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1746
 *     # 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":1748
 *         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":1749
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1751
 *         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 = 1751; __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 = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1752
 *     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 = 1752; __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 = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1753
 *         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 = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1755
 *         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":1756
 * 
 *     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":1757
 *     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":1758
 *         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":1759
 *         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":1760
 *         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":1761
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1762
 *                 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":1763
 *                     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":1765
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * @cython.boundscheck(False)
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1766
 *             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":1735
 * @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":1769
 * @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_187backfill_2d_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_187backfill_2d_inplace_bool = {"backfill_2d_inplace_bool", (PyCFunction)__pyx_pw_6pandas_5algos_187backfill_2d_inplace_bool, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_187backfill_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":1771
 * 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 = 1769; __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 = 1769; __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 = 1769; __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 = 1769; __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 = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_186backfill_2d_inplace_bool(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit);

  /* "pandas/src/generated.pyx":1769
 * @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_186backfill_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 = 1769; __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 = 1769; __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":1774
 *     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":1776
 *     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 = 1776; __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 = 1776; __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 = 1776; __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 = 1776; __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 = 1776; __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 = 1776; __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 = 1776; __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 = 1776; __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 = 1776; __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":1779
 * 
 *     # GH 2778
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":1780
 *     # 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":1782
 *         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":1783
 * 
 *     if limit is None:
 *         lim = N             # <<<<<<<<<<<<<<
 *     else:
 *         if limit < 0:
 */
    __pyx_v_lim = __pyx_v_N;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":1785
 *         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 = 1785; __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 = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pandas/src/generated.pyx":1786
 *     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 = 1786; __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 = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pandas/src/generated.pyx":1787
 *         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 = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_lim = __pyx_t_10;
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":1789
 *         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":1790
 * 
 *     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":1791
 *     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":1792
 *         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":1793
 *         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":1794
 *         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":1795
 *             if mask[j, i]:
 *                 if fill_count >= lim:
 *                     continue             # <<<<<<<<<<<<<<
 *                 fill_count += 1
 *                 values[j, i] = val
 */
          goto __pyx_L10_continue;
        }

        /* "pandas/src/generated.pyx":1796
 *                 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":1797
 *                     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":1799
 *                 values[j, i] = val
 *             else:
 *                 fill_count = 0             # <<<<<<<<<<<<<<
 *                 val = values[j, i]
 * 
 */
        __pyx_v_fill_count = 0;

        /* "pandas/src/generated.pyx":1800
 *             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":1769
 * @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":1804
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_float64(ndarray[float64_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_189is_monotonic_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_188is_monotonic_float64[] = "\n    Returns\n    -------\n    is_monotonic_inc, is_monotonic_dec, is_unique\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_189is_monotonic_float64 = {"is_monotonic_float64", (PyCFunction)__pyx_pw_6pandas_5algos_189is_monotonic_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_188is_monotonic_float64};
static PyObject *__pyx_pw_6pandas_5algos_189is_monotonic_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  int __pyx_v_timelike;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_monotonic_float64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_timelike,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_arr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timelike)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("is_monotonic_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_monotonic_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_arr = ((PyArrayObject *)values[0]);
    __pyx_v_timelike = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_timelike == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_monotonic_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.is_monotonic_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 = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_188is_monotonic_float64(__pyx_self, __pyx_v_arr, __pyx_v_timelike);

  /* 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_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_timelike) {
  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;
  int __pyx_v_is_monotonic_inc;
  int __pyx_v_is_monotonic_dec;
  __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;
  long __pyx_t_4;
  int __pyx_t_5;
  long __pyx_t_6;
  long __pyx_t_7;
  long __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;
  PyObject *__pyx_t_14 = 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 = 1804; __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":1813
 *         Py_ssize_t i, n
 *         float64_t prev, cur
 *         bint is_unique = 1             # <<<<<<<<<<<<<<
 *         bint is_monotonic_inc = 1
 *         bint is_monotonic_dec = 1
 */
  __pyx_v_is_unique = 1;

  /* "pandas/src/generated.pyx":1814
 *         float64_t prev, cur
 *         bint is_unique = 1
 *         bint is_monotonic_inc = 1             # <<<<<<<<<<<<<<
 *         bint is_monotonic_dec = 1
 * 
 */
  __pyx_v_is_monotonic_inc = 1;

  /* "pandas/src/generated.pyx":1815
 *         bint is_unique = 1
 *         bint is_monotonic_inc = 1
 *         bint is_monotonic_dec = 1             # <<<<<<<<<<<<<<
 * 
 *     n = len(arr)
 */
  __pyx_v_is_monotonic_dec = 1;

  /* "pandas/src/generated.pyx":1817
 *         bint is_monotonic_dec = 1
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 * 
 *     if n == 1:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":1819
 *     n = len(arr)
 * 
 *     if n == 1:             # <<<<<<<<<<<<<<
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 */
  __pyx_t_2 = ((__pyx_v_n == 1) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1820
 * 
 *     if n == 1:
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):             # <<<<<<<<<<<<<<
 *             # single value is NaN
 *             return False, False, True
 */
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides)) != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_arr.diminfo[0].strides))) != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_timelike != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_6 = 0;
    __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_6pandas_5algos_iNaT) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1822
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 *             return False, False, True             # <<<<<<<<<<<<<<
 *         else:
 *             return True, True, True
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__96);
      __pyx_r = __pyx_tuple__96;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1824
 *             return False, False, True
 *         else:
 *             return True, True, True             # <<<<<<<<<<<<<<
 *     elif n < 2:
 *         return True, True, True
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__97);
      __pyx_r = __pyx_tuple__97;
      goto __pyx_L0;
    }
  }

  /* "pandas/src/generated.pyx":1825
 *         else:
 *             return True, True, True
 *     elif n < 2:             # <<<<<<<<<<<<<<
 *         return True, True, True
 * 
 */
  __pyx_t_2 = ((__pyx_v_n < 2) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1826
 *             return True, True, True
 *     elif n < 2:
 *         return True, True, True             # <<<<<<<<<<<<<<
 * 
 *     if timelike and arr[0] == iNaT:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__98);
    __pyx_r = __pyx_tuple__98;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1828
 *         return True, True, True
 * 
 *     if timelike and arr[0] == iNaT:             # <<<<<<<<<<<<<<
 *         return False, False, None
 * 
 */
  __pyx_t_5 = (__pyx_v_timelike != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_2 = __pyx_t_5;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_7 = 0;
  __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_6pandas_5algos_iNaT) != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1829
 * 
 *     if timelike and arr[0] == iNaT:
 *         return False, False, None             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__99);
    __pyx_r = __pyx_tuple__99;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1831
 *         return False, False, None
 * 
 *     prev = arr[0]             # <<<<<<<<<<<<<<
 *     for i in range(1, n):
 *         cur = arr[i]
 */
  __pyx_t_8 = 0;
  __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_arr.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1832
 * 
 *     prev = arr[0]
 *     for i in range(1, n):             # <<<<<<<<<<<<<<
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_9 = 1; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "pandas/src/generated.pyx":1833
 *     prev = arr[0]
 *     for i in range(1, n):
 *         cur = arr[i]             # <<<<<<<<<<<<<<
 *         if timelike and cur == iNaT:
 *             return False, False, None
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_arr.diminfo[0].strides));

    /* "pandas/src/generated.pyx":1834
 *     for i in range(1, n):
 *         cur = arr[i]
 *         if timelike and cur == iNaT:             # <<<<<<<<<<<<<<
 *             return False, False, None
 *         if cur < prev:
 */
    __pyx_t_5 = (__pyx_v_timelike != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_t_5 = ((__pyx_v_cur == __pyx_v_6pandas_5algos_iNaT) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L14_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1835
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             is_monotonic_inc = 0
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__100);
      __pyx_r = __pyx_tuple__100;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":1836
 *         if timelike and cur == iNaT:
 *             return False, False, None
 *         if cur < prev:             # <<<<<<<<<<<<<<
 *             is_monotonic_inc = 0
 *         elif cur > prev:
 */
    __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1837
 *             return False, False, None
 *         if cur < prev:
 *             is_monotonic_inc = 0             # <<<<<<<<<<<<<<
 *         elif cur > prev:
 *             is_monotonic_dec = 0
 */
      __pyx_v_is_monotonic_inc = 0;
      goto __pyx_L16;
    }

    /* "pandas/src/generated.pyx":1838
 *         if cur < prev:
 *             is_monotonic_inc = 0
 *         elif cur > prev:             # <<<<<<<<<<<<<<
 *             is_monotonic_dec = 0
 *         elif cur == prev:
 */
    __pyx_t_2 = ((__pyx_v_cur > __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1839
 *             is_monotonic_inc = 0
 *         elif cur > prev:
 *             is_monotonic_dec = 0             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
      __pyx_v_is_monotonic_dec = 0;
      goto __pyx_L16;
    }

    /* "pandas/src/generated.pyx":1840
 *         elif cur > prev:
 *             is_monotonic_dec = 0
 *         elif cur == prev:             # <<<<<<<<<<<<<<
 *             is_unique = 0
 *         else:
 */
    __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1841
 *             is_monotonic_dec = 0
 *         elif cur == prev:
 *             is_unique = 0             # <<<<<<<<<<<<<<
 *         else:
 *             # cur or prev is NaN
 */
      __pyx_v_is_unique = 0;
      goto __pyx_L16;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1844
 *         else:
 *             # cur or prev is NaN
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__101);
      __pyx_r = __pyx_tuple__101;
      goto __pyx_L0;
    }
    __pyx_L16:;

    /* "pandas/src/generated.pyx":1845
 *             # cur or prev is NaN
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:             # <<<<<<<<<<<<<<
 *             return False, False, None
 *         prev = cur
 */
    __pyx_t_5 = ((!(__pyx_v_is_monotonic_inc != 0)) != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L18_bool_binop_done;
    }
    __pyx_t_5 = ((!(__pyx_v_is_monotonic_dec != 0)) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L18_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1846
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__102);
      __pyx_r = __pyx_tuple__102;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":1847
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 *         prev = cur             # <<<<<<<<<<<<<<
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 * @cython.boundscheck(False)
 */
    __pyx_v_prev = __pyx_v_cur;
  }

  /* "pandas/src/generated.pyx":1848
 *             return False, False, None
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_v_is_monotonic_inc); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_is_monotonic_dec); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_r = __pyx_t_14;
  __pyx_t_14 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":1804
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_float64(ndarray[float64_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

  /* function exit code */
  __pyx_L1_error:;
  __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_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":1851
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_float32(ndarray[float32_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_191is_monotonic_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_190is_monotonic_float32[] = "\n    Returns\n    -------\n    is_monotonic_inc, is_monotonic_dec, is_unique\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_191is_monotonic_float32 = {"is_monotonic_float32", (PyCFunction)__pyx_pw_6pandas_5algos_191is_monotonic_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_190is_monotonic_float32};
static PyObject *__pyx_pw_6pandas_5algos_191is_monotonic_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  int __pyx_v_timelike;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_monotonic_float32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_timelike,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_arr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timelike)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("is_monotonic_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_monotonic_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_arr = ((PyArrayObject *)values[0]);
    __pyx_v_timelike = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_timelike == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_monotonic_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.is_monotonic_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 = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_190is_monotonic_float32(__pyx_self, __pyx_v_arr, __pyx_v_timelike);

  /* 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_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_timelike) {
  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;
  int __pyx_v_is_monotonic_inc;
  int __pyx_v_is_monotonic_dec;
  __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;
  long __pyx_t_4;
  int __pyx_t_5;
  long __pyx_t_6;
  long __pyx_t_7;
  long __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;
  PyObject *__pyx_t_14 = 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 = 1851; __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":1860
 *         Py_ssize_t i, n
 *         float32_t prev, cur
 *         bint is_unique = 1             # <<<<<<<<<<<<<<
 *         bint is_monotonic_inc = 1
 *         bint is_monotonic_dec = 1
 */
  __pyx_v_is_unique = 1;

  /* "pandas/src/generated.pyx":1861
 *         float32_t prev, cur
 *         bint is_unique = 1
 *         bint is_monotonic_inc = 1             # <<<<<<<<<<<<<<
 *         bint is_monotonic_dec = 1
 * 
 */
  __pyx_v_is_monotonic_inc = 1;

  /* "pandas/src/generated.pyx":1862
 *         bint is_unique = 1
 *         bint is_monotonic_inc = 1
 *         bint is_monotonic_dec = 1             # <<<<<<<<<<<<<<
 * 
 *     n = len(arr)
 */
  __pyx_v_is_monotonic_dec = 1;

  /* "pandas/src/generated.pyx":1864
 *         bint is_monotonic_dec = 1
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 * 
 *     if n == 1:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":1866
 *     n = len(arr)
 * 
 *     if n == 1:             # <<<<<<<<<<<<<<
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 */
  __pyx_t_2 = ((__pyx_v_n == 1) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1867
 * 
 *     if n == 1:
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):             # <<<<<<<<<<<<<<
 *             # single value is NaN
 *             return False, False, True
 */
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides)) != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_arr.diminfo[0].strides))) != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_timelike != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_6 = 0;
    __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_6pandas_5algos_iNaT) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1869
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 *             return False, False, True             # <<<<<<<<<<<<<<
 *         else:
 *             return True, True, True
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__103);
      __pyx_r = __pyx_tuple__103;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1871
 *             return False, False, True
 *         else:
 *             return True, True, True             # <<<<<<<<<<<<<<
 *     elif n < 2:
 *         return True, True, True
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__104);
      __pyx_r = __pyx_tuple__104;
      goto __pyx_L0;
    }
  }

  /* "pandas/src/generated.pyx":1872
 *         else:
 *             return True, True, True
 *     elif n < 2:             # <<<<<<<<<<<<<<
 *         return True, True, True
 * 
 */
  __pyx_t_2 = ((__pyx_v_n < 2) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1873
 *             return True, True, True
 *     elif n < 2:
 *         return True, True, True             # <<<<<<<<<<<<<<
 * 
 *     if timelike and arr[0] == iNaT:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__105);
    __pyx_r = __pyx_tuple__105;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1875
 *         return True, True, True
 * 
 *     if timelike and arr[0] == iNaT:             # <<<<<<<<<<<<<<
 *         return False, False, None
 * 
 */
  __pyx_t_5 = (__pyx_v_timelike != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_2 = __pyx_t_5;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_7 = 0;
  __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_6pandas_5algos_iNaT) != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1876
 * 
 *     if timelike and arr[0] == iNaT:
 *         return False, False, None             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__106);
    __pyx_r = __pyx_tuple__106;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1878
 *         return False, False, None
 * 
 *     prev = arr[0]             # <<<<<<<<<<<<<<
 *     for i in range(1, n):
 *         cur = arr[i]
 */
  __pyx_t_8 = 0;
  __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_arr.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1879
 * 
 *     prev = arr[0]
 *     for i in range(1, n):             # <<<<<<<<<<<<<<
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_9 = 1; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "pandas/src/generated.pyx":1880
 *     prev = arr[0]
 *     for i in range(1, n):
 *         cur = arr[i]             # <<<<<<<<<<<<<<
 *         if timelike and cur == iNaT:
 *             return False, False, None
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_arr.diminfo[0].strides));

    /* "pandas/src/generated.pyx":1881
 *     for i in range(1, n):
 *         cur = arr[i]
 *         if timelike and cur == iNaT:             # <<<<<<<<<<<<<<
 *             return False, False, None
 *         if cur < prev:
 */
    __pyx_t_5 = (__pyx_v_timelike != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_t_5 = ((__pyx_v_cur == __pyx_v_6pandas_5algos_iNaT) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L14_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1882
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             is_monotonic_inc = 0
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__107);
      __pyx_r = __pyx_tuple__107;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":1883
 *         if timelike and cur == iNaT:
 *             return False, False, None
 *         if cur < prev:             # <<<<<<<<<<<<<<
 *             is_monotonic_inc = 0
 *         elif cur > prev:
 */
    __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1884
 *             return False, False, None
 *         if cur < prev:
 *             is_monotonic_inc = 0             # <<<<<<<<<<<<<<
 *         elif cur > prev:
 *             is_monotonic_dec = 0
 */
      __pyx_v_is_monotonic_inc = 0;
      goto __pyx_L16;
    }

    /* "pandas/src/generated.pyx":1885
 *         if cur < prev:
 *             is_monotonic_inc = 0
 *         elif cur > prev:             # <<<<<<<<<<<<<<
 *             is_monotonic_dec = 0
 *         elif cur == prev:
 */
    __pyx_t_2 = ((__pyx_v_cur > __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1886
 *             is_monotonic_inc = 0
 *         elif cur > prev:
 *             is_monotonic_dec = 0             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
      __pyx_v_is_monotonic_dec = 0;
      goto __pyx_L16;
    }

    /* "pandas/src/generated.pyx":1887
 *         elif cur > prev:
 *             is_monotonic_dec = 0
 *         elif cur == prev:             # <<<<<<<<<<<<<<
 *             is_unique = 0
 *         else:
 */
    __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1888
 *             is_monotonic_dec = 0
 *         elif cur == prev:
 *             is_unique = 0             # <<<<<<<<<<<<<<
 *         else:
 *             # cur or prev is NaN
 */
      __pyx_v_is_unique = 0;
      goto __pyx_L16;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1891
 *         else:
 *             # cur or prev is NaN
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__108);
      __pyx_r = __pyx_tuple__108;
      goto __pyx_L0;
    }
    __pyx_L16:;

    /* "pandas/src/generated.pyx":1892
 *             # cur or prev is NaN
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:             # <<<<<<<<<<<<<<
 *             return False, False, None
 *         prev = cur
 */
    __pyx_t_5 = ((!(__pyx_v_is_monotonic_inc != 0)) != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L18_bool_binop_done;
    }
    __pyx_t_5 = ((!(__pyx_v_is_monotonic_dec != 0)) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L18_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1893
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__109);
      __pyx_r = __pyx_tuple__109;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":1894
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 *         prev = cur             # <<<<<<<<<<<<<<
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 * @cython.boundscheck(False)
 */
    __pyx_v_prev = __pyx_v_cur;
  }

  /* "pandas/src/generated.pyx":1895
 *             return False, False, None
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_v_is_monotonic_inc); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_is_monotonic_dec); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_r = __pyx_t_14;
  __pyx_t_14 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":1851
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_float32(ndarray[float32_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

  /* function exit code */
  __pyx_L1_error:;
  __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_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":1898
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_object(ndarray[object] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_193is_monotonic_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_192is_monotonic_object[] = "\n    Returns\n    -------\n    is_monotonic_inc, is_monotonic_dec, is_unique\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_193is_monotonic_object = {"is_monotonic_object", (PyCFunction)__pyx_pw_6pandas_5algos_193is_monotonic_object, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_192is_monotonic_object};
static PyObject *__pyx_pw_6pandas_5algos_193is_monotonic_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  int __pyx_v_timelike;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_monotonic_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_timelike,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_arr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timelike)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("is_monotonic_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_monotonic_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_arr = ((PyArrayObject *)values[0]);
    __pyx_v_timelike = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_timelike == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_monotonic_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.is_monotonic_object", __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 = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_192is_monotonic_object(__pyx_self, __pyx_v_arr, __pyx_v_timelike);

  /* 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_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_timelike) {
  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;
  int __pyx_v_is_monotonic_inc;
  int __pyx_v_is_monotonic_dec;
  __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;
  PyObject *__pyx_t_5 = NULL;
  long __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  long __pyx_t_9;
  long __pyx_t_10;
  long __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject *__pyx_t_14 = 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 = 1898; __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":1907
 *         Py_ssize_t i, n
 *         object prev, cur
 *         bint is_unique = 1             # <<<<<<<<<<<<<<
 *         bint is_monotonic_inc = 1
 *         bint is_monotonic_dec = 1
 */
  __pyx_v_is_unique = 1;

  /* "pandas/src/generated.pyx":1908
 *         object prev, cur
 *         bint is_unique = 1
 *         bint is_monotonic_inc = 1             # <<<<<<<<<<<<<<
 *         bint is_monotonic_dec = 1
 * 
 */
  __pyx_v_is_monotonic_inc = 1;

  /* "pandas/src/generated.pyx":1909
 *         bint is_unique = 1
 *         bint is_monotonic_inc = 1
 *         bint is_monotonic_dec = 1             # <<<<<<<<<<<<<<
 * 
 *     n = len(arr)
 */
  __pyx_v_is_monotonic_dec = 1;

  /* "pandas/src/generated.pyx":1911
 *         bint is_monotonic_dec = 1
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 * 
 *     if n == 1:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":1913
 *     n = len(arr)
 * 
 *     if n == 1:             # <<<<<<<<<<<<<<
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 */
  __pyx_t_2 = ((__pyx_v_n == 1) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1914
 * 
 *     if n == 1:
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):             # <<<<<<<<<<<<<<
 *             # single value is NaN
 *             return False, False, True
 */
    __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_t_6 = 0;
    __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_5);
    __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (!__pyx_t_8) {
    } else {
      __pyx_t_2 = __pyx_t_8;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_8 = (__pyx_v_timelike != 0);
    if (__pyx_t_8) {
    } else {
      __pyx_t_2 = __pyx_t_8;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_9 = 0;
    __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_7);
    __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5algos_iNaT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_7, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __pyx_t_8;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1916
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 *             return False, False, True             # <<<<<<<<<<<<<<
 *         else:
 *             return True, True, True
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__110);
      __pyx_r = __pyx_tuple__110;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1918
 *             return False, False, True
 *         else:
 *             return True, True, True             # <<<<<<<<<<<<<<
 *     elif n < 2:
 *         return True, True, True
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__111);
      __pyx_r = __pyx_tuple__111;
      goto __pyx_L0;
    }
  }

  /* "pandas/src/generated.pyx":1919
 *         else:
 *             return True, True, True
 *     elif n < 2:             # <<<<<<<<<<<<<<
 *         return True, True, True
 * 
 */
  __pyx_t_2 = ((__pyx_v_n < 2) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1920
 *             return True, True, True
 *     elif n < 2:
 *         return True, True, True             # <<<<<<<<<<<<<<
 * 
 *     if timelike and arr[0] == iNaT:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__112);
    __pyx_r = __pyx_tuple__112;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1922
 *         return True, True, True
 * 
 *     if timelike and arr[0] == iNaT:             # <<<<<<<<<<<<<<
 *         return False, False, None
 * 
 */
  __pyx_t_8 = (__pyx_v_timelike != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_2 = __pyx_t_8;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_10 = 0;
  __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_arr.diminfo[0].strides);
  __Pyx_INCREF((PyObject*)__pyx_t_3);
  __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5algos_iNaT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_2 = __pyx_t_8;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1923
 * 
 *     if timelike and arr[0] == iNaT:
 *         return False, False, None             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__113);
    __pyx_r = __pyx_tuple__113;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1925
 *         return False, False, None
 * 
 *     prev = arr[0]             # <<<<<<<<<<<<<<
 *     for i in range(1, n):
 *         cur = arr[i]
 */
  __pyx_t_11 = 0;
  __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides);
  __Pyx_INCREF((PyObject*)__pyx_t_7);
  __pyx_v_prev = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "pandas/src/generated.pyx":1926
 * 
 *     prev = arr[0]
 *     for i in range(1, n):             # <<<<<<<<<<<<<<
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":1927
 *     prev = arr[0]
 *     for i in range(1, n):
 *         cur = arr[i]             # <<<<<<<<<<<<<<
 *         if timelike and cur == iNaT:
 *             return False, False, None
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_7);
    __Pyx_XDECREF_SET(__pyx_v_cur, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "pandas/src/generated.pyx":1928
 *     for i in range(1, n):
 *         cur = arr[i]
 *         if timelike and cur == iNaT:             # <<<<<<<<<<<<<<
 *             return False, False, None
 *         if cur < prev:
 */
    __pyx_t_8 = (__pyx_v_timelike != 0);
    if (__pyx_t_8) {
    } else {
      __pyx_t_2 = __pyx_t_8;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5algos_iNaT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_cur, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __pyx_t_8;
    __pyx_L14_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1929
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             is_monotonic_inc = 0
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__114);
      __pyx_r = __pyx_tuple__114;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":1930
 *         if timelike and cur == iNaT:
 *             return False, False, None
 *         if cur < prev:             # <<<<<<<<<<<<<<
 *             is_monotonic_inc = 0
 *         elif cur > prev:
 */
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_cur, __pyx_v_prev, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1931
 *             return False, False, None
 *         if cur < prev:
 *             is_monotonic_inc = 0             # <<<<<<<<<<<<<<
 *         elif cur > prev:
 *             is_monotonic_dec = 0
 */
      __pyx_v_is_monotonic_inc = 0;
      goto __pyx_L16;
    }

    /* "pandas/src/generated.pyx":1932
 *         if cur < prev:
 *             is_monotonic_inc = 0
 *         elif cur > prev:             # <<<<<<<<<<<<<<
 *             is_monotonic_dec = 0
 *         elif cur == prev:
 */
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_cur, __pyx_v_prev, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1933
 *             is_monotonic_inc = 0
 *         elif cur > prev:
 *             is_monotonic_dec = 0             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
      __pyx_v_is_monotonic_dec = 0;
      goto __pyx_L16;
    }

    /* "pandas/src/generated.pyx":1934
 *         elif cur > prev:
 *             is_monotonic_dec = 0
 *         elif cur == prev:             # <<<<<<<<<<<<<<
 *             is_unique = 0
 *         else:
 */
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_cur, __pyx_v_prev, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1935
 *             is_monotonic_dec = 0
 *         elif cur == prev:
 *             is_unique = 0             # <<<<<<<<<<<<<<
 *         else:
 *             # cur or prev is NaN
 */
      __pyx_v_is_unique = 0;
      goto __pyx_L16;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1938
 *         else:
 *             # cur or prev is NaN
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__115);
      __pyx_r = __pyx_tuple__115;
      goto __pyx_L0;
    }
    __pyx_L16:;

    /* "pandas/src/generated.pyx":1939
 *             # cur or prev is NaN
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:             # <<<<<<<<<<<<<<
 *             return False, False, None
 *         prev = cur
 */
    __pyx_t_8 = ((!(__pyx_v_is_monotonic_inc != 0)) != 0);
    if (__pyx_t_8) {
    } else {
      __pyx_t_2 = __pyx_t_8;
      goto __pyx_L18_bool_binop_done;
    }
    __pyx_t_8 = ((!(__pyx_v_is_monotonic_dec != 0)) != 0);
    __pyx_t_2 = __pyx_t_8;
    __pyx_L18_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1940
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__116);
      __pyx_r = __pyx_tuple__116;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":1941
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 *         prev = cur             # <<<<<<<<<<<<<<
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 * @cython.boundscheck(False)
 */
    __Pyx_INCREF(__pyx_v_cur);
    __Pyx_DECREF_SET(__pyx_v_prev, __pyx_v_cur);
  }

  /* "pandas/src/generated.pyx":1942
 *             return False, False, None
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_is_monotonic_inc); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_is_monotonic_dec); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_14;
  __pyx_t_14 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":1898
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_object(ndarray[object] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_14);
  { 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":1945
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_int32(ndarray[int32_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_195is_monotonic_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_194is_monotonic_int32[] = "\n    Returns\n    -------\n    is_monotonic_inc, is_monotonic_dec, is_unique\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_195is_monotonic_int32 = {"is_monotonic_int32", (PyCFunction)__pyx_pw_6pandas_5algos_195is_monotonic_int32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_194is_monotonic_int32};
static PyObject *__pyx_pw_6pandas_5algos_195is_monotonic_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  int __pyx_v_timelike;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_monotonic_int32 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_timelike,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_arr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timelike)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("is_monotonic_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_monotonic_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_arr = ((PyArrayObject *)values[0]);
    __pyx_v_timelike = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_timelike == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_monotonic_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.is_monotonic_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 = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_194is_monotonic_int32(__pyx_self, __pyx_v_arr, __pyx_v_timelike);

  /* 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_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_timelike) {
  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;
  int __pyx_v_is_monotonic_inc;
  int __pyx_v_is_monotonic_dec;
  __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;
  long __pyx_t_4;
  int __pyx_t_5;
  long __pyx_t_6;
  long __pyx_t_7;
  long __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;
  PyObject *__pyx_t_14 = 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 = 1945; __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":1954
 *         Py_ssize_t i, n
 *         int32_t prev, cur
 *         bint is_unique = 1             # <<<<<<<<<<<<<<
 *         bint is_monotonic_inc = 1
 *         bint is_monotonic_dec = 1
 */
  __pyx_v_is_unique = 1;

  /* "pandas/src/generated.pyx":1955
 *         int32_t prev, cur
 *         bint is_unique = 1
 *         bint is_monotonic_inc = 1             # <<<<<<<<<<<<<<
 *         bint is_monotonic_dec = 1
 * 
 */
  __pyx_v_is_monotonic_inc = 1;

  /* "pandas/src/generated.pyx":1956
 *         bint is_unique = 1
 *         bint is_monotonic_inc = 1
 *         bint is_monotonic_dec = 1             # <<<<<<<<<<<<<<
 * 
 *     n = len(arr)
 */
  __pyx_v_is_monotonic_dec = 1;

  /* "pandas/src/generated.pyx":1958
 *         bint is_monotonic_dec = 1
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 * 
 *     if n == 1:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":1960
 *     n = len(arr)
 * 
 *     if n == 1:             # <<<<<<<<<<<<<<
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 */
  __pyx_t_2 = ((__pyx_v_n == 1) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1961
 * 
 *     if n == 1:
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):             # <<<<<<<<<<<<<<
 *             # single value is NaN
 *             return False, False, True
 */
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides)) != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_arr.diminfo[0].strides))) != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_timelike != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_6 = 0;
    __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_6pandas_5algos_iNaT) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1963
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 *             return False, False, True             # <<<<<<<<<<<<<<
 *         else:
 *             return True, True, True
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__117);
      __pyx_r = __pyx_tuple__117;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1965
 *             return False, False, True
 *         else:
 *             return True, True, True             # <<<<<<<<<<<<<<
 *     elif n < 2:
 *         return True, True, True
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__118);
      __pyx_r = __pyx_tuple__118;
      goto __pyx_L0;
    }
  }

  /* "pandas/src/generated.pyx":1966
 *         else:
 *             return True, True, True
 *     elif n < 2:             # <<<<<<<<<<<<<<
 *         return True, True, True
 * 
 */
  __pyx_t_2 = ((__pyx_v_n < 2) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1967
 *             return True, True, True
 *     elif n < 2:
 *         return True, True, True             # <<<<<<<<<<<<<<
 * 
 *     if timelike and arr[0] == iNaT:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__119);
    __pyx_r = __pyx_tuple__119;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1969
 *         return True, True, True
 * 
 *     if timelike and arr[0] == iNaT:             # <<<<<<<<<<<<<<
 *         return False, False, None
 * 
 */
  __pyx_t_5 = (__pyx_v_timelike != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_2 = __pyx_t_5;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_7 = 0;
  __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_6pandas_5algos_iNaT) != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":1970
 * 
 *     if timelike and arr[0] == iNaT:
 *         return False, False, None             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__120);
    __pyx_r = __pyx_tuple__120;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":1972
 *         return False, False, None
 * 
 *     prev = arr[0]             # <<<<<<<<<<<<<<
 *     for i in range(1, n):
 *         cur = arr[i]
 */
  __pyx_t_8 = 0;
  __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_arr.diminfo[0].strides));

  /* "pandas/src/generated.pyx":1973
 * 
 *     prev = arr[0]
 *     for i in range(1, n):             # <<<<<<<<<<<<<<
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_9 = 1; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "pandas/src/generated.pyx":1974
 *     prev = arr[0]
 *     for i in range(1, n):
 *         cur = arr[i]             # <<<<<<<<<<<<<<
 *         if timelike and cur == iNaT:
 *             return False, False, None
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_arr.diminfo[0].strides));

    /* "pandas/src/generated.pyx":1975
 *     for i in range(1, n):
 *         cur = arr[i]
 *         if timelike and cur == iNaT:             # <<<<<<<<<<<<<<
 *             return False, False, None
 *         if cur < prev:
 */
    __pyx_t_5 = (__pyx_v_timelike != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_t_5 = ((__pyx_v_cur == __pyx_v_6pandas_5algos_iNaT) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L14_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1976
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             is_monotonic_inc = 0
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__121);
      __pyx_r = __pyx_tuple__121;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":1977
 *         if timelike and cur == iNaT:
 *             return False, False, None
 *         if cur < prev:             # <<<<<<<<<<<<<<
 *             is_monotonic_inc = 0
 *         elif cur > prev:
 */
    __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1978
 *             return False, False, None
 *         if cur < prev:
 *             is_monotonic_inc = 0             # <<<<<<<<<<<<<<
 *         elif cur > prev:
 *             is_monotonic_dec = 0
 */
      __pyx_v_is_monotonic_inc = 0;
      goto __pyx_L16;
    }

    /* "pandas/src/generated.pyx":1979
 *         if cur < prev:
 *             is_monotonic_inc = 0
 *         elif cur > prev:             # <<<<<<<<<<<<<<
 *             is_monotonic_dec = 0
 *         elif cur == prev:
 */
    __pyx_t_2 = ((__pyx_v_cur > __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1980
 *             is_monotonic_inc = 0
 *         elif cur > prev:
 *             is_monotonic_dec = 0             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
      __pyx_v_is_monotonic_dec = 0;
      goto __pyx_L16;
    }

    /* "pandas/src/generated.pyx":1981
 *         elif cur > prev:
 *             is_monotonic_dec = 0
 *         elif cur == prev:             # <<<<<<<<<<<<<<
 *             is_unique = 0
 *         else:
 */
    __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1982
 *             is_monotonic_dec = 0
 *         elif cur == prev:
 *             is_unique = 0             # <<<<<<<<<<<<<<
 *         else:
 *             # cur or prev is NaN
 */
      __pyx_v_is_unique = 0;
      goto __pyx_L16;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":1985
 *         else:
 *             # cur or prev is NaN
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__122);
      __pyx_r = __pyx_tuple__122;
      goto __pyx_L0;
    }
    __pyx_L16:;

    /* "pandas/src/generated.pyx":1986
 *             # cur or prev is NaN
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:             # <<<<<<<<<<<<<<
 *             return False, False, None
 *         prev = cur
 */
    __pyx_t_5 = ((!(__pyx_v_is_monotonic_inc != 0)) != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L18_bool_binop_done;
    }
    __pyx_t_5 = ((!(__pyx_v_is_monotonic_dec != 0)) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L18_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":1987
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__123);
      __pyx_r = __pyx_tuple__123;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":1988
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 *         prev = cur             # <<<<<<<<<<<<<<
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 * @cython.boundscheck(False)
 */
    __pyx_v_prev = __pyx_v_cur;
  }

  /* "pandas/src/generated.pyx":1989
 *             return False, False, None
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_v_is_monotonic_inc); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_is_monotonic_dec); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_r = __pyx_t_14;
  __pyx_t_14 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":1945
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_int32(ndarray[int32_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

  /* function exit code */
  __pyx_L1_error:;
  __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_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":1992
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_int64(ndarray[int64_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_197is_monotonic_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_196is_monotonic_int64[] = "\n    Returns\n    -------\n    is_monotonic_inc, is_monotonic_dec, is_unique\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_197is_monotonic_int64 = {"is_monotonic_int64", (PyCFunction)__pyx_pw_6pandas_5algos_197is_monotonic_int64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_196is_monotonic_int64};
static PyObject *__pyx_pw_6pandas_5algos_197is_monotonic_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  int __pyx_v_timelike;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_monotonic_int64 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_timelike,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_arr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timelike)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("is_monotonic_int64", 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, "is_monotonic_int64") < 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_arr = ((PyArrayObject *)values[0]);
    __pyx_v_timelike = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_timelike == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_monotonic_int64", 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.is_monotonic_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 = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_196is_monotonic_int64(__pyx_self, __pyx_v_arr, __pyx_v_timelike);

  /* 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_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_timelike) {
  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;
  int __pyx_v_is_monotonic_inc;
  int __pyx_v_is_monotonic_dec;
  __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;
  long __pyx_t_4;
  int __pyx_t_5;
  long __pyx_t_6;
  long __pyx_t_7;
  long __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;
  PyObject *__pyx_t_14 = 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 = 1992; __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":2001
 *         Py_ssize_t i, n
 *         int64_t prev, cur
 *         bint is_unique = 1             # <<<<<<<<<<<<<<
 *         bint is_monotonic_inc = 1
 *         bint is_monotonic_dec = 1
 */
  __pyx_v_is_unique = 1;

  /* "pandas/src/generated.pyx":2002
 *         int64_t prev, cur
 *         bint is_unique = 1
 *         bint is_monotonic_inc = 1             # <<<<<<<<<<<<<<
 *         bint is_monotonic_dec = 1
 * 
 */
  __pyx_v_is_monotonic_inc = 1;

  /* "pandas/src/generated.pyx":2003
 *         bint is_unique = 1
 *         bint is_monotonic_inc = 1
 *         bint is_monotonic_dec = 1             # <<<<<<<<<<<<<<
 * 
 *     n = len(arr)
 */
  __pyx_v_is_monotonic_dec = 1;

  /* "pandas/src/generated.pyx":2005
 *         bint is_monotonic_dec = 1
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 * 
 *     if n == 1:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2007
 *     n = len(arr)
 * 
 *     if n == 1:             # <<<<<<<<<<<<<<
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 */
  __pyx_t_2 = ((__pyx_v_n == 1) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":2008
 * 
 *     if n == 1:
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):             # <<<<<<<<<<<<<<
 *             # single value is NaN
 *             return False, False, True
 */
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides)) != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_arr.diminfo[0].strides))) != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_timelike != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_6 = 0;
    __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_6pandas_5algos_iNaT) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":2010
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 *             return False, False, True             # <<<<<<<<<<<<<<
 *         else:
 *             return True, True, True
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__124);
      __pyx_r = __pyx_tuple__124;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2012
 *             return False, False, True
 *         else:
 *             return True, True, True             # <<<<<<<<<<<<<<
 *     elif n < 2:
 *         return True, True, True
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__125);
      __pyx_r = __pyx_tuple__125;
      goto __pyx_L0;
    }
  }

  /* "pandas/src/generated.pyx":2013
 *         else:
 *             return True, True, True
 *     elif n < 2:             # <<<<<<<<<<<<<<
 *         return True, True, True
 * 
 */
  __pyx_t_2 = ((__pyx_v_n < 2) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":2014
 *             return True, True, True
 *     elif n < 2:
 *         return True, True, True             # <<<<<<<<<<<<<<
 * 
 *     if timelike and arr[0] == iNaT:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__126);
    __pyx_r = __pyx_tuple__126;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":2016
 *         return True, True, True
 * 
 *     if timelike and arr[0] == iNaT:             # <<<<<<<<<<<<<<
 *         return False, False, None
 * 
 */
  __pyx_t_5 = (__pyx_v_timelike != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_2 = __pyx_t_5;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_7 = 0;
  __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_6pandas_5algos_iNaT) != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":2017
 * 
 *     if timelike and arr[0] == iNaT:
 *         return False, False, None             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__127);
    __pyx_r = __pyx_tuple__127;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":2019
 *         return False, False, None
 * 
 *     prev = arr[0]             # <<<<<<<<<<<<<<
 *     for i in range(1, n):
 *         cur = arr[i]
 */
  __pyx_t_8 = 0;
  __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_arr.diminfo[0].strides));

  /* "pandas/src/generated.pyx":2020
 * 
 *     prev = arr[0]
 *     for i in range(1, n):             # <<<<<<<<<<<<<<
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_9 = 1; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "pandas/src/generated.pyx":2021
 *     prev = arr[0]
 *     for i in range(1, n):
 *         cur = arr[i]             # <<<<<<<<<<<<<<
 *         if timelike and cur == iNaT:
 *             return False, False, None
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_arr.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2022
 *     for i in range(1, n):
 *         cur = arr[i]
 *         if timelike and cur == iNaT:             # <<<<<<<<<<<<<<
 *             return False, False, None
 *         if cur < prev:
 */
    __pyx_t_5 = (__pyx_v_timelike != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_t_5 = ((__pyx_v_cur == __pyx_v_6pandas_5algos_iNaT) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L14_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":2023
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             is_monotonic_inc = 0
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__128);
      __pyx_r = __pyx_tuple__128;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":2024
 *         if timelike and cur == iNaT:
 *             return False, False, None
 *         if cur < prev:             # <<<<<<<<<<<<<<
 *             is_monotonic_inc = 0
 *         elif cur > prev:
 */
    __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":2025
 *             return False, False, None
 *         if cur < prev:
 *             is_monotonic_inc = 0             # <<<<<<<<<<<<<<
 *         elif cur > prev:
 *             is_monotonic_dec = 0
 */
      __pyx_v_is_monotonic_inc = 0;
      goto __pyx_L16;
    }

    /* "pandas/src/generated.pyx":2026
 *         if cur < prev:
 *             is_monotonic_inc = 0
 *         elif cur > prev:             # <<<<<<<<<<<<<<
 *             is_monotonic_dec = 0
 *         elif cur == prev:
 */
    __pyx_t_2 = ((__pyx_v_cur > __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":2027
 *             is_monotonic_inc = 0
 *         elif cur > prev:
 *             is_monotonic_dec = 0             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
      __pyx_v_is_monotonic_dec = 0;
      goto __pyx_L16;
    }

    /* "pandas/src/generated.pyx":2028
 *         elif cur > prev:
 *             is_monotonic_dec = 0
 *         elif cur == prev:             # <<<<<<<<<<<<<<
 *             is_unique = 0
 *         else:
 */
    __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":2029
 *             is_monotonic_dec = 0
 *         elif cur == prev:
 *             is_unique = 0             # <<<<<<<<<<<<<<
 *         else:
 *             # cur or prev is NaN
 */
      __pyx_v_is_unique = 0;
      goto __pyx_L16;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2032
 *         else:
 *             # cur or prev is NaN
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__129);
      __pyx_r = __pyx_tuple__129;
      goto __pyx_L0;
    }
    __pyx_L16:;

    /* "pandas/src/generated.pyx":2033
 *             # cur or prev is NaN
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:             # <<<<<<<<<<<<<<
 *             return False, False, None
 *         prev = cur
 */
    __pyx_t_5 = ((!(__pyx_v_is_monotonic_inc != 0)) != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L18_bool_binop_done;
    }
    __pyx_t_5 = ((!(__pyx_v_is_monotonic_dec != 0)) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L18_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":2034
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__130);
      __pyx_r = __pyx_tuple__130;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":2035
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 *         prev = cur             # <<<<<<<<<<<<<<
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 * @cython.boundscheck(False)
 */
    __pyx_v_prev = __pyx_v_cur;
  }

  /* "pandas/src/generated.pyx":2036
 *             return False, False, None
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_v_is_monotonic_inc); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_is_monotonic_dec); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_r = __pyx_t_14;
  __pyx_t_14 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":1992
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_int64(ndarray[int64_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

  /* function exit code */
  __pyx_L1_error:;
  __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_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":2039
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_bool(ndarray[uint8_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_199is_monotonic_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_198is_monotonic_bool[] = "\n    Returns\n    -------\n    is_monotonic_inc, is_monotonic_dec, is_unique\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_199is_monotonic_bool = {"is_monotonic_bool", (PyCFunction)__pyx_pw_6pandas_5algos_199is_monotonic_bool, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_198is_monotonic_bool};
static PyObject *__pyx_pw_6pandas_5algos_199is_monotonic_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  int __pyx_v_timelike;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_monotonic_bool (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_timelike,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_arr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timelike)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("is_monotonic_bool", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_monotonic_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_arr = ((PyArrayObject *)values[0]);
    __pyx_v_timelike = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_timelike == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_monotonic_bool", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.is_monotonic_bool", __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 = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_198is_monotonic_bool(__pyx_self, __pyx_v_arr, __pyx_v_timelike);

  /* 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_198is_monotonic_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_timelike) {
  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;
  int __pyx_v_is_monotonic_inc;
  int __pyx_v_is_monotonic_dec;
  __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;
  long __pyx_t_4;
  int __pyx_t_5;
  long __pyx_t_6;
  long __pyx_t_7;
  long __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;
  PyObject *__pyx_t_14 = 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 = 2039; __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":2048
 *         Py_ssize_t i, n
 *         uint8_t prev, cur
 *         bint is_unique = 1             # <<<<<<<<<<<<<<
 *         bint is_monotonic_inc = 1
 *         bint is_monotonic_dec = 1
 */
  __pyx_v_is_unique = 1;

  /* "pandas/src/generated.pyx":2049
 *         uint8_t prev, cur
 *         bint is_unique = 1
 *         bint is_monotonic_inc = 1             # <<<<<<<<<<<<<<
 *         bint is_monotonic_dec = 1
 * 
 */
  __pyx_v_is_monotonic_inc = 1;

  /* "pandas/src/generated.pyx":2050
 *         bint is_unique = 1
 *         bint is_monotonic_inc = 1
 *         bint is_monotonic_dec = 1             # <<<<<<<<<<<<<<
 * 
 *     n = len(arr)
 */
  __pyx_v_is_monotonic_dec = 1;

  /* "pandas/src/generated.pyx":2052
 *         bint is_monotonic_dec = 1
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 * 
 *     if n == 1:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2054
 *     n = len(arr)
 * 
 *     if n == 1:             # <<<<<<<<<<<<<<
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 */
  __pyx_t_2 = ((__pyx_v_n == 1) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":2055
 * 
 *     if n == 1:
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):             # <<<<<<<<<<<<<<
 *             # single value is NaN
 *             return False, False, True
 */
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides)) != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_arr.diminfo[0].strides))) != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_timelike != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_6 = 0;
    __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_6pandas_5algos_iNaT) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":2057
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 *             return False, False, True             # <<<<<<<<<<<<<<
 *         else:
 *             return True, True, True
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__131);
      __pyx_r = __pyx_tuple__131;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2059
 *             return False, False, True
 *         else:
 *             return True, True, True             # <<<<<<<<<<<<<<
 *     elif n < 2:
 *         return True, True, True
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__132);
      __pyx_r = __pyx_tuple__132;
      goto __pyx_L0;
    }
  }

  /* "pandas/src/generated.pyx":2060
 *         else:
 *             return True, True, True
 *     elif n < 2:             # <<<<<<<<<<<<<<
 *         return True, True, True
 * 
 */
  __pyx_t_2 = ((__pyx_v_n < 2) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":2061
 *             return True, True, True
 *     elif n < 2:
 *         return True, True, True             # <<<<<<<<<<<<<<
 * 
 *     if timelike and arr[0] == iNaT:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__133);
    __pyx_r = __pyx_tuple__133;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":2063
 *         return True, True, True
 * 
 *     if timelike and arr[0] == iNaT:             # <<<<<<<<<<<<<<
 *         return False, False, None
 * 
 */
  __pyx_t_5 = (__pyx_v_timelike != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_2 = __pyx_t_5;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_7 = 0;
  __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_6pandas_5algos_iNaT) != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":2064
 * 
 *     if timelike and arr[0] == iNaT:
 *         return False, False, None             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__134);
    __pyx_r = __pyx_tuple__134;
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":2066
 *         return False, False, None
 * 
 *     prev = arr[0]             # <<<<<<<<<<<<<<
 *     for i in range(1, n):
 *         cur = arr[i]
 */
  __pyx_t_8 = 0;
  __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_arr.diminfo[0].strides));

  /* "pandas/src/generated.pyx":2067
 * 
 *     prev = arr[0]
 *     for i in range(1, n):             # <<<<<<<<<<<<<<
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_9 = 1; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "pandas/src/generated.pyx":2068
 *     prev = arr[0]
 *     for i in range(1, n):
 *         cur = arr[i]             # <<<<<<<<<<<<<<
 *         if timelike and cur == iNaT:
 *             return False, False, None
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_arr.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2069
 *     for i in range(1, n):
 *         cur = arr[i]
 *         if timelike and cur == iNaT:             # <<<<<<<<<<<<<<
 *             return False, False, None
 *         if cur < prev:
 */
    __pyx_t_5 = (__pyx_v_timelike != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_t_5 = ((__pyx_v_cur == __pyx_v_6pandas_5algos_iNaT) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L14_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":2070
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             is_monotonic_inc = 0
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__135);
      __pyx_r = __pyx_tuple__135;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":2071
 *         if timelike and cur == iNaT:
 *             return False, False, None
 *         if cur < prev:             # <<<<<<<<<<<<<<
 *             is_monotonic_inc = 0
 *         elif cur > prev:
 */
    __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":2072
 *             return False, False, None
 *         if cur < prev:
 *             is_monotonic_inc = 0             # <<<<<<<<<<<<<<
 *         elif cur > prev:
 *             is_monotonic_dec = 0
 */
      __pyx_v_is_monotonic_inc = 0;
      goto __pyx_L16;
    }

    /* "pandas/src/generated.pyx":2073
 *         if cur < prev:
 *             is_monotonic_inc = 0
 *         elif cur > prev:             # <<<<<<<<<<<<<<
 *             is_monotonic_dec = 0
 *         elif cur == prev:
 */
    __pyx_t_2 = ((__pyx_v_cur > __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":2074
 *             is_monotonic_inc = 0
 *         elif cur > prev:
 *             is_monotonic_dec = 0             # <<<<<<<<<<<<<<
 *         elif cur == prev:
 *             is_unique = 0
 */
      __pyx_v_is_monotonic_dec = 0;
      goto __pyx_L16;
    }

    /* "pandas/src/generated.pyx":2075
 *         elif cur > prev:
 *             is_monotonic_dec = 0
 *         elif cur == prev:             # <<<<<<<<<<<<<<
 *             is_unique = 0
 *         else:
 */
    __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0);
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":2076
 *             is_monotonic_dec = 0
 *         elif cur == prev:
 *             is_unique = 0             # <<<<<<<<<<<<<<
 *         else:
 *             # cur or prev is NaN
 */
      __pyx_v_is_unique = 0;
      goto __pyx_L16;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2079
 *         else:
 *             # cur or prev is NaN
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__136);
      __pyx_r = __pyx_tuple__136;
      goto __pyx_L0;
    }
    __pyx_L16:;

    /* "pandas/src/generated.pyx":2080
 *             # cur or prev is NaN
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:             # <<<<<<<<<<<<<<
 *             return False, False, None
 *         prev = cur
 */
    __pyx_t_5 = ((!(__pyx_v_is_monotonic_inc != 0)) != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L18_bool_binop_done;
    }
    __pyx_t_5 = ((!(__pyx_v_is_monotonic_dec != 0)) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L18_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pandas/src/generated.pyx":2081
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__137);
      __pyx_r = __pyx_tuple__137;
      goto __pyx_L0;
    }

    /* "pandas/src/generated.pyx":2082
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 *         prev = cur             # <<<<<<<<<<<<<<
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 * 
 */
    __pyx_v_prev = __pyx_v_cur;
  }

  /* "pandas/src/generated.pyx":2083
 *             return False, False, None
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_v_is_monotonic_inc); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_is_monotonic_dec); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_r = __pyx_t_14;
  __pyx_t_14 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":2039
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_bool(ndarray[uint8_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */

  /* function exit code */
  __pyx_L1_error:;
  __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_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":2087
 * @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_201groupby_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_201groupby_float64 = {"groupby_float64", (PyCFunction)__pyx_pw_6pandas_5algos_201groupby_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_201groupby_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 = 2087; __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 = 2087; __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 = 2087; __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 = 2087; __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 = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_200groupby_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_200groupby_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 = 2087; __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":2088
 * @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 = 2088; __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":2093
 *     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 = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":2095
 *     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 = 2095; __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":2096
 * 
 *     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__138, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2096; __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 = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":2098
 *        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":2099
 * 
 *     for i in range(length):
 *         key = util.get_value_1d(labels, i)             # <<<<<<<<<<<<<<
 * 
 *         if is_null_datetimelike(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 = 2099; __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":2101
 *         key = util.get_value_1d(labels, i)
 * 
 *         if is_null_datetimelike(key):             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_3 = (__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_key) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":2102
 * 
 *         if is_null_datetimelike(key):
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         idx = index[i]
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":2104
 *             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 = 2104; __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":2105
 * 
 *         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 = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_3 != 0);
    if (__pyx_t_6) {

      /* "pandas/src/generated.pyx":2106
 *         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 = 2106; __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 = 2106; __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":2107
 *         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 = 2107; __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 = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2109
 *             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 = 2109; __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 = 2109; __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":2111
 *             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":2087
 * @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":2115
 * @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_203groupby_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_203groupby_float32 = {"groupby_float32", (PyCFunction)__pyx_pw_6pandas_5algos_203groupby_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_203groupby_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 = 2115; __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 = 2115; __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 = 2115; __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 = 2115; __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 = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_202groupby_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_202groupby_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 = 2115; __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":2116
 * @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 = 2116; __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":2121
 *     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 = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":2123
 *     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 = 2123; __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":2124
 * 
 *     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__139, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2124; __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 = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":2126
 *        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":2127
 * 
 *     for i in range(length):
 *         key = util.get_value_1d(labels, i)             # <<<<<<<<<<<<<<
 * 
 *         if is_null_datetimelike(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 = 2127; __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":2129
 *         key = util.get_value_1d(labels, i)
 * 
 *         if is_null_datetimelike(key):             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_3 = (__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_key) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":2130
 * 
 *         if is_null_datetimelike(key):
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         idx = index[i]
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":2132
 *             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 = 2132; __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":2133
 * 
 *         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 = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_3 != 0);
    if (__pyx_t_6) {

      /* "pandas/src/generated.pyx":2134
 *         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 = 2134; __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 = 2134; __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":2135
 *         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 = 2135; __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 = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2137
 *             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 = 2137; __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 = 2137; __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":2139
 *             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":2115
 * @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":2143
 * @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_205groupby_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_205groupby_object = {"groupby_object", (PyCFunction)__pyx_pw_6pandas_5algos_205groupby_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_205groupby_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 = 2143; __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 = 2143; __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 = 2143; __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 = 2143; __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 = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_204groupby_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_204groupby_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 = 2143; __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":2144
 * @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 = 2144; __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":2149
 *     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 = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":2151
 *     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 = 2151; __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":2152
 * 
 *     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__140, NULL); 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_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":2154
 *        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":2155
 * 
 *     for i in range(length):
 *         key = util.get_value_1d(labels, i)             # <<<<<<<<<<<<<<
 * 
 *         if is_null_datetimelike(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 = 2155; __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":2157
 *         key = util.get_value_1d(labels, i)
 * 
 *         if is_null_datetimelike(key):             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_3 = (__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_key) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":2158
 * 
 *         if is_null_datetimelike(key):
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         idx = index[i]
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":2160
 *             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":2161
 * 
 *         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 = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_3 != 0);
    if (__pyx_t_6) {

      /* "pandas/src/generated.pyx":2162
 *         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 = 2162; __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 = 2162; __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":2163
 *         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 = 2163; __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 = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2165
 *             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 = 2165; __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 = 2165; __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":2167
 *             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":2143
 * @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":2171
 * @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_207groupby_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_207groupby_int32 = {"groupby_int32", (PyCFunction)__pyx_pw_6pandas_5algos_207groupby_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_207groupby_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 = 2171; __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 = 2171; __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 = 2171; __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 = 2171; __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 = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_206groupby_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_206groupby_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 = 2171; __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":2172
 * @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 = 2172; __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":2177
 *     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 = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":2179
 *     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 = 2179; __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":2180
 * 
 *     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__141, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2180; __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 = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":2182
 *        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":2183
 * 
 *     for i in range(length):
 *         key = util.get_value_1d(labels, i)             # <<<<<<<<<<<<<<
 * 
 *         if is_null_datetimelike(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 = 2183; __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":2185
 *         key = util.get_value_1d(labels, i)
 * 
 *         if is_null_datetimelike(key):             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_3 = (__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_key) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":2186
 * 
 *         if is_null_datetimelike(key):
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         idx = index[i]
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":2188
 *             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 = 2188; __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":2189
 * 
 *         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 = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_3 != 0);
    if (__pyx_t_6) {

      /* "pandas/src/generated.pyx":2190
 *         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 = 2190; __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 = 2190; __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":2191
 *         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 = 2191; __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 = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2193
 *             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 = 2193; __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 = 2193; __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":2195
 *             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":2171
 * @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":2199
 * @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_209groupby_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_209groupby_int64 = {"groupby_int64", (PyCFunction)__pyx_pw_6pandas_5algos_209groupby_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_209groupby_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 = 2199; __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 = 2199; __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 = 2199; __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 = 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[2]; __pyx_lineno = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_208groupby_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_208groupby_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 = 2199; __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":2200
 * @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 = 2200; __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":2205
 *     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 = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":2207
 *     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 = 2207; __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":2208
 * 
 *     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__142, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __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 = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":2210
 *        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":2211
 * 
 *     for i in range(length):
 *         key = util.get_value_1d(labels, i)             # <<<<<<<<<<<<<<
 * 
 *         if is_null_datetimelike(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 = 2211; __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":2213
 *         key = util.get_value_1d(labels, i)
 * 
 *         if is_null_datetimelike(key):             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_3 = (__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_key) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":2214
 * 
 *         if is_null_datetimelike(key):
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         idx = index[i]
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":2216
 *             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 = 2216; __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":2217
 * 
 *         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 = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_3 != 0);
    if (__pyx_t_6) {

      /* "pandas/src/generated.pyx":2218
 *         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 = 2218; __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 = 2218; __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":2219
 *         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 = 2219; __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 = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2221
 *             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 = 2221; __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 = 2221; __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":2223
 *             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":2199
 * @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":2227
 * @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_211groupby_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_211groupby_bool = {"groupby_bool", (PyCFunction)__pyx_pw_6pandas_5algos_211groupby_bool, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_211groupby_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 = 2227; __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 = 2227; __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 = 2227; __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 = 2227; __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 = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_210groupby_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_210groupby_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 = 2227; __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":2228
 * @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 = 2228; __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":2233
 *     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 = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/generated.pyx":2235
 *     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 = 2235; __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":2236
 * 
 *     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__143, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2236; __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 = 2236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":2238
 *        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":2239
 * 
 *     for i in range(length):
 *         key = util.get_value_1d(labels, i)             # <<<<<<<<<<<<<<
 * 
 *         if is_null_datetimelike(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 = 2239; __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":2241
 *         key = util.get_value_1d(labels, i)
 * 
 *         if is_null_datetimelike(key):             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_3 = (__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_key) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/generated.pyx":2242
 * 
 *         if is_null_datetimelike(key):
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         idx = index[i]
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":2244
 *             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 = 2244; __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":2245
 * 
 *         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 = 2245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_3 != 0);
    if (__pyx_t_6) {

      /* "pandas/src/generated.pyx":2246
 *         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 = 2246; __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 = 2246; __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":2247
 *         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 = 2247; __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 = 2247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2249
 *             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 = 2249; __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 = 2249; __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":2251
 *             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":2227
 * @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":2256
 * @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_213arrmap_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_213arrmap_float64 = {"arrmap_float64", (PyCFunction)__pyx_pw_6pandas_5algos_213arrmap_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_213arrmap_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 = 2256; __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 = 2256; __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 = 2256; __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 = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_212arrmap_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_212arrmap_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 = 2256; __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":2257
 * @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":2258
 * 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":2260
 *     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 = 2260; __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 = 2260; __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 = 2260; __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 = 2260; __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 = 2260; __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 = 2260; __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 = 2260; __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 = 2260; __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 = 2260; __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 = 2260; __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 = 2260; __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":2262
 *     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 = 2262; __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 = 2262; __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 = 2262; __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":2264
 *     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":2265
 * 
 *     for i in range(length):
 *         result[i] = func(index[i])             # <<<<<<<<<<<<<<
 * 
 *     return maybe_convert_objects(result)
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_5 = 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_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_func);
    __pyx_t_3 = __pyx_v_func; __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2265; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2265; __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_3); __pyx_t_3 = 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":2267
 *         result[i] = func(index[i])
 * 
 *     return maybe_convert_objects(result)             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_maybe_convert_objects);
  __pyx_t_3 = __pyx_v_maybe_convert_objects; __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2267; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_result));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2267; __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_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":2256
 * @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":2271
 * @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_215arrmap_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_215arrmap_float32 = {"arrmap_float32", (PyCFunction)__pyx_pw_6pandas_5algos_215arrmap_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_215arrmap_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 = 2271; __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 = 2271; __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 = 2271; __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 = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_214arrmap_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_214arrmap_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 = 2271; __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":2272
 * @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":2273
 * 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":2275
 *     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 = 2275; __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 = 2275; __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 = 2275; __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 = 2275; __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 = 2275; __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 = 2275; __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 = 2275; __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 = 2275; __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 = 2275; __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 = 2275; __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 = 2275; __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":2277
 *     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 = 2277; __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 = 2277; __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 = 2277; __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":2279
 *     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":2280
 * 
 *     for i in range(length):
 *         result[i] = func(index[i])             # <<<<<<<<<<<<<<
 * 
 *     return maybe_convert_objects(result)
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_5 = 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_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_func);
    __pyx_t_3 = __pyx_v_func; __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __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_3); __pyx_t_3 = 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":2282
 *         result[i] = func(index[i])
 * 
 *     return maybe_convert_objects(result)             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_maybe_convert_objects);
  __pyx_t_3 = __pyx_v_maybe_convert_objects; __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2282; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_result));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2282; __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_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":2271
 * @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":2286
 * @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_217arrmap_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_217arrmap_object = {"arrmap_object", (PyCFunction)__pyx_pw_6pandas_5algos_217arrmap_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_217arrmap_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 = 2286; __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 = 2286; __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 = 2286; __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 = 2286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_216arrmap_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_216arrmap_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 = 2286; __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":2287
 * @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":2288
 * 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":2290
 *     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 = 2290; __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 = 2290; __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 = 2290; __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 = 2290; __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 = 2290; __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 = 2290; __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 = 2290; __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 = 2290; __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 = 2290; __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 = 2290; __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 = 2290; __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":2292
 *     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 = 2292; __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 = 2292; __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 = 2292; __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":2294
 *     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":2295
 * 
 *     for i in range(length):
 *         result[i] = func(index[i])             # <<<<<<<<<<<<<<
 * 
 *     return maybe_convert_objects(result)
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_5);
    __Pyx_INCREF(__pyx_v_func);
    __pyx_t_3 = __pyx_v_func; __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2295; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2295; __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_3); __pyx_t_3 = 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":2297
 *         result[i] = func(index[i])
 * 
 *     return maybe_convert_objects(result)             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_maybe_convert_objects);
  __pyx_t_3 = __pyx_v_maybe_convert_objects; __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2297; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_result));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2297; __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_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":2286
 * @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":2301
 * @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_219arrmap_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_219arrmap_int32 = {"arrmap_int32", (PyCFunction)__pyx_pw_6pandas_5algos_219arrmap_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_219arrmap_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 = 2301; __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 = 2301; __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 = 2301; __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 = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_218arrmap_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_218arrmap_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 = 2301; __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":2302
 * @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":2303
 * 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":2305
 *     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 = 2305; __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 = 2305; __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 = 2305; __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 = 2305; __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 = 2305; __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 = 2305; __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 = 2305; __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 = 2305; __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 = 2305; __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 = 2305; __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 = 2305; __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":2307
 *     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 = 2307; __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 = 2307; __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 = 2307; __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":2309
 *     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":2310
 * 
 *     for i in range(length):
 *         result[i] = func(index[i])             # <<<<<<<<<<<<<<
 * 
 *     return maybe_convert_objects(result)
 */
    __pyx_t_9 = __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_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_func);
    __pyx_t_3 = __pyx_v_func; __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2310; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2310; __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_3); __pyx_t_3 = 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":2312
 *         result[i] = func(index[i])
 * 
 *     return maybe_convert_objects(result)             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_maybe_convert_objects);
  __pyx_t_3 = __pyx_v_maybe_convert_objects; __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2312; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_result));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2312; __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_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":2301
 * @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":2316
 * @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_221arrmap_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_221arrmap_int64 = {"arrmap_int64", (PyCFunction)__pyx_pw_6pandas_5algos_221arrmap_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_221arrmap_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 = 2316; __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 = 2316; __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 = 2316; __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 = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_220arrmap_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_220arrmap_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 = 2316; __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":2317
 * @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":2318
 * 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":2320
 *     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 = 2320; __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 = 2320; __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 = 2320; __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 = 2320; __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 = 2320; __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 = 2320; __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 = 2320; __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 = 2320; __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 = 2320; __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 = 2320; __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 = 2320; __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":2322
 *     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 = 2322; __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 = 2322; __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 = 2322; __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":2324
 *     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":2325
 * 
 *     for i in range(length):
 *         result[i] = func(index[i])             # <<<<<<<<<<<<<<
 * 
 *     return maybe_convert_objects(result)
 */
    __pyx_t_9 = __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_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_func);
    __pyx_t_3 = __pyx_v_func; __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2325; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2325; __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_3); __pyx_t_3 = 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":2327
 *         result[i] = func(index[i])
 * 
 *     return maybe_convert_objects(result)             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_maybe_convert_objects);
  __pyx_t_3 = __pyx_v_maybe_convert_objects; __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2327; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_result));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2327; __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_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":2316
 * @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":2331
 * @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_223arrmap_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_223arrmap_bool = {"arrmap_bool", (PyCFunction)__pyx_pw_6pandas_5algos_223arrmap_bool, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_223arrmap_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 = 2331; __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 = 2331; __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 = 2331; __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 = 2331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_222arrmap_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_222arrmap_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 = 2331; __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":2332
 * @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":2333
 * 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":2335
 *     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 = 2335; __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 = 2335; __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 = 2335; __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 = 2335; __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 = 2335; __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 = 2335; __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 = 2335; __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 = 2335; __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 = 2335; __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 = 2335; __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 = 2335; __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":2337
 *     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 = 2337; __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 = 2337; __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 = 2337; __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":2339
 *     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":2340
 * 
 *     for i in range(length):
 *         result[i] = func(index[i])             # <<<<<<<<<<<<<<
 * 
 *     return maybe_convert_objects(result)
 */
    __pyx_t_9 = __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_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_func);
    __pyx_t_3 = __pyx_v_func; __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2340; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2340; __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_3); __pyx_t_3 = 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":2342
 *         result[i] = func(index[i])
 * 
 *     return maybe_convert_objects(result)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_maybe_convert_objects);
  __pyx_t_3 = __pyx_v_maybe_convert_objects; __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2342; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_result));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2342; __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_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":2331
 * @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":2346
 * 
 * @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_225take_1d_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_225take_1d_bool_bool = {"take_1d_bool_bool", (PyCFunction)__pyx_pw_6pandas_5algos_225take_1d_bool_bool, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_225take_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__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_1d_bool_bool", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2346; __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 = 2346; __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 = 2346; __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 = 2346; __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 = 2346; __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 = 2347; __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 = 2348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_224take_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_224take_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 = 2346; __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 = 2346; __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 = 2346; __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":2354
 *         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 = 2354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2356
 *     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 = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2357
 * 
 *     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":2358
 *     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 = 2358; __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":2359
 *     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":2360
 *         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 = 2360; __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":2362
 *             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 = 2362; __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 = 2362; __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":2346
 * 
 * @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":2365
 * 
 * @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_227take_1d_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_227take_1d_bool_object = {"take_1d_bool_object", (PyCFunction)__pyx_pw_6pandas_5algos_227take_1d_bool_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_227take_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__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_1d_bool_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2365; __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 = 2365; __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 = 2365; __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 = 2365; __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 = 2365; __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 = 2366; __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 = 2367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_226take_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_226take_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 = 2365; __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 = 2365; __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 = 2365; __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":2373
 *         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 = 2373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2375
 *     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":2376
 * 
 *     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":2377
 *     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 = 2377; __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":2378
 *     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":2379
 *         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 = 2379; __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":2381
 *             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 = 2381; __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 = 2381; __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":2365
 * 
 * @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":2384
 * 
 * @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_229take_1d_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_229take_1d_int8_int8 = {"take_1d_int8_int8", (PyCFunction)__pyx_pw_6pandas_5algos_229take_1d_int8_int8, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_229take_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__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_1d_int8_int8", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2384; __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 = 2384; __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 = 2384; __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 = 2384; __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 = 2384; __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 = 2385; __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 = 2386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_228take_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_228take_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 = 2384; __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 = 2384; __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 = 2384; __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":2392
 *         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 = 2392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2394
 *     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 = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2395
 * 
 *     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":2396
 *     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 = 2396; __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":2397
 *     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":2398
 *         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 = 2398; __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":2400
 *             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 = 2400; __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 = 2400; __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":2384
 * 
 * @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":2403
 * 
 * @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_231take_1d_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_231take_1d_int8_int32 = {"take_1d_int8_int32", (PyCFunction)__pyx_pw_6pandas_5algos_231take_1d_int8_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_231take_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__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_1d_int8_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2403; __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 = 2403; __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 = 2403; __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 = 2403; __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 = 2403; __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 = 2404; __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 = 2405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_230take_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_230take_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 = 2403; __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 = 2403; __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 = 2403; __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":2411
 *         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 = 2411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2413
 *     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 = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2414
 * 
 *     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":2415
 *     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 = 2415; __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":2416
 *     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":2417
 *         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 = 2417; __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":2419
 *             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 = 2419; __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 = 2419; __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":2403
 * 
 * @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":2422
 * 
 * @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_233take_1d_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_233take_1d_int8_int64 = {"take_1d_int8_int64", (PyCFunction)__pyx_pw_6pandas_5algos_233take_1d_int8_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_233take_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__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_1d_int8_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2422; __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 = 2422; __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 = 2422; __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 = 2422; __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 = 2422; __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 = 2423; __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 = 2424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_232take_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_232take_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 = 2422; __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 = 2422; __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 = 2422; __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":2430
 *         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 = 2430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2432
 *     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 = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2433
 * 
 *     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":2434
 *     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 = 2434; __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":2435
 *     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":2436
 *         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 = 2436; __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":2438
 *             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 = 2438; __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 = 2438; __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":2422
 * 
 * @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":2441
 * 
 * @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_235take_1d_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_235take_1d_int8_float64 = {"take_1d_int8_float64", (PyCFunction)__pyx_pw_6pandas_5algos_235take_1d_int8_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_235take_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__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_1d_int8_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2441; __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 = 2441; __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 = 2441; __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 = 2441; __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 = 2441; __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 = 2442; __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 = 2443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_234take_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_234take_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 = 2441; __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 = 2441; __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 = 2441; __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":2449
 *         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 = 2449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2451
 *     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 = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2452
 * 
 *     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":2453
 *     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 = 2453; __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":2454
 *     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":2455
 *         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 = 2455; __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":2457
 *             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 = 2457; __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 = 2457; __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":2441
 * 
 * @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":2460
 * 
 * @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_237take_1d_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_237take_1d_int16_int16 = {"take_1d_int16_int16", (PyCFunction)__pyx_pw_6pandas_5algos_237take_1d_int16_int16, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_237take_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__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_1d_int16_int16", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2460; __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 = 2460; __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 = 2460; __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 = 2460; __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 = 2460; __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 = 2461; __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 = 2462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_236take_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_236take_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 = 2460; __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 = 2460; __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 = 2460; __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":2468
 *         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 = 2468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2470
 *     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 = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2471
 * 
 *     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":2472
 *     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 = 2472; __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":2473
 *     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":2474
 *         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 = 2474; __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":2476
 *             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 = 2476; __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 = 2476; __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":2460
 * 
 * @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":2479
 * 
 * @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_239take_1d_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_239take_1d_int16_int32 = {"take_1d_int16_int32", (PyCFunction)__pyx_pw_6pandas_5algos_239take_1d_int16_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_239take_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__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_1d_int16_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2479; __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 = 2479; __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 = 2479; __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 = 2479; __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 = 2479; __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 = 2480; __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 = 2481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_238take_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_238take_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 = 2479; __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 = 2479; __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 = 2479; __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":2487
 *         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 = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2489
 *     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 = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2490
 * 
 *     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":2491
 *     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 = 2491; __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":2492
 *     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":2493
 *         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 = 2493; __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":2495
 *             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 = 2495; __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 = 2495; __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":2479
 * 
 * @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":2498
 * 
 * @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_241take_1d_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_241take_1d_int16_int64 = {"take_1d_int16_int64", (PyCFunction)__pyx_pw_6pandas_5algos_241take_1d_int16_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_241take_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__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_1d_int16_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2498; __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 = 2498; __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 = 2498; __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 = 2498; __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 = 2498; __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 = 2499; __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 = 2500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_240take_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_240take_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 = 2498; __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 = 2498; __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 = 2498; __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":2506
 *         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 = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2508
 *     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 = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2509
 * 
 *     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":2510
 *     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 = 2510; __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":2511
 *     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":2512
 *         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 = 2512; __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":2514
 *             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 = 2514; __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 = 2514; __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":2498
 * 
 * @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":2517
 * 
 * @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_243take_1d_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_243take_1d_int16_float64 = {"take_1d_int16_float64", (PyCFunction)__pyx_pw_6pandas_5algos_243take_1d_int16_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_243take_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__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_1d_int16_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2517; __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 = 2517; __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 = 2517; __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 = 2517; __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 = 2517; __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 = 2518; __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 = 2519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_242take_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_242take_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 = 2517; __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 = 2517; __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 = 2517; __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":2525
 *         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 = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2527
 *     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 = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2528
 * 
 *     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":2529
 *     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 = 2529; __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":2530
 *     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":2531
 *         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 = 2531; __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":2533
 *             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 = 2533; __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 = 2533; __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":2517
 * 
 * @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":2536
 * 
 * @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_245take_1d_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_245take_1d_int32_int32 = {"take_1d_int32_int32", (PyCFunction)__pyx_pw_6pandas_5algos_245take_1d_int32_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_245take_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__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_1d_int32_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2536; __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 = 2536; __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 = 2536; __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 = 2536; __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 = 2536; __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 = 2537; __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 = 2538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_244take_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_244take_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 = 2536; __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 = 2536; __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 = 2536; __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":2544
 *         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 = 2544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2546
 *     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 = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2547
 * 
 *     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":2548
 *     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 = 2548; __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":2549
 *     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":2550
 *         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 = 2550; __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":2552
 *             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 = 2552; __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 = 2552; __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":2536
 * 
 * @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":2555
 * 
 * @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_247take_1d_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_247take_1d_int32_int64 = {"take_1d_int32_int64", (PyCFunction)__pyx_pw_6pandas_5algos_247take_1d_int32_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_247take_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__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_1d_int32_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2555; __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 = 2555; __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 = 2555; __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 = 2555; __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 = 2555; __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 = 2556; __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 = 2557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_246take_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_246take_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 = 2555; __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 = 2555; __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 = 2555; __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":2563
 *         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 = 2563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2565
 *     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 = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2566
 * 
 *     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":2567
 *     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 = 2567; __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":2568
 *     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":2569
 *         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 = 2569; __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":2571
 *             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 = 2571; __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 = 2571; __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":2555
 * 
 * @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":2574
 * 
 * @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_249take_1d_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_249take_1d_int32_float64 = {"take_1d_int32_float64", (PyCFunction)__pyx_pw_6pandas_5algos_249take_1d_int32_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_249take_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__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_1d_int32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2574; __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 = 2574; __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 = 2574; __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 = 2574; __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 = 2574; __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 = 2575; __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 = 2576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_248take_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_248take_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 = 2574; __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 = 2574; __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 = 2574; __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":2582
 *         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 = 2582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2584
 *     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 = 2584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2585
 * 
 *     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":2586
 *     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 = 2586; __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":2587
 *     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":2588
 *         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 = 2588; __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":2590
 *             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 = 2590; __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 = 2590; __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":2574
 * 
 * @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":2593
 * 
 * @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_251take_1d_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_251take_1d_int64_int64 = {"take_1d_int64_int64", (PyCFunction)__pyx_pw_6pandas_5algos_251take_1d_int64_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_251take_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__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_1d_int64_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2593; __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 = 2593; __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 = 2593; __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 = 2593; __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 = 2593; __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 = 2594; __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 = 2595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_250take_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_250take_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 = 2593; __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 = 2593; __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 = 2593; __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":2601
 *         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 = 2601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2603
 *     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 = 2603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2604
 * 
 *     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":2605
 *     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 = 2605; __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":2606
 *     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":2607
 *         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 = 2607; __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":2609
 *             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 = 2609; __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 = 2609; __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":2593
 * 
 * @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":2612
 * 
 * @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_253take_1d_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_253take_1d_int64_float64 = {"take_1d_int64_float64", (PyCFunction)__pyx_pw_6pandas_5algos_253take_1d_int64_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_253take_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__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_1d_int64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2612; __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 = 2612; __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 = 2612; __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 = 2612; __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 = 2612; __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 = 2613; __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 = 2614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_252take_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_252take_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 = 2612; __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 = 2612; __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 = 2612; __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":2620
 *         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 = 2620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2622
 *     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 = 2622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2623
 * 
 *     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":2624
 *     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 = 2624; __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":2625
 *     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":2626
 *         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 = 2626; __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":2628
 *             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 = 2628; __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 = 2628; __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":2612
 * 
 * @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":2631
 * 
 * @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_255take_1d_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_255take_1d_float32_float32 = {"take_1d_float32_float32", (PyCFunction)__pyx_pw_6pandas_5algos_255take_1d_float32_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_255take_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__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_1d_float32_float32", 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_1d_float32_float32", 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_1d_float32_float32") < 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 = ((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 = 2631; __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 = 2631; __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 = 2632; __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 = 2633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_254take_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_254take_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 = 2631; __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 = 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];
  {
    __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 = 2631; __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":2639
 *         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 = 2639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2641
 *     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 = 2641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2642
 * 
 *     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":2643
 *     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 = 2643; __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":2644
 *     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":2645
 *         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 = 2645; __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":2647
 *             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 = 2647; __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 = 2647; __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":2631
 * 
 * @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":2650
 * 
 * @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_257take_1d_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_257take_1d_float32_float64 = {"take_1d_float32_float64", (PyCFunction)__pyx_pw_6pandas_5algos_257take_1d_float32_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_257take_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__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_1d_float32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2650; __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 = 2650; __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 = 2650; __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 = 2650; __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 = 2650; __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 = 2651; __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 = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_256take_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_256take_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 = 2650; __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 = 2650; __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 = 2650; __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":2658
 *         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 = 2658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2660
 *     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 = 2660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2661
 * 
 *     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":2662
 *     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 = 2662; __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":2663
 *     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":2664
 *         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 = 2664; __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":2666
 *             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 = 2666; __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 = 2666; __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":2650
 * 
 * @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":2669
 * 
 * @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_259take_1d_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_259take_1d_float64_float64 = {"take_1d_float64_float64", (PyCFunction)__pyx_pw_6pandas_5algos_259take_1d_float64_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_259take_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__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_1d_float64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2669; __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 = 2669; __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 = 2669; __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 = 2669; __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 = 2669; __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 = 2670; __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 = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_258take_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_258take_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 = 2669; __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 = 2669; __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 = 2669; __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":2677
 *         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 = 2677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2679
 *     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 = 2679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_2;

  /* "pandas/src/generated.pyx":2680
 * 
 *     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":2681
 *     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 = 2681; __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":2682
 *     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":2683
 *         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 = 2683; __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":2685
 *             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 = 2685; __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 = 2685; __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":2669
 * 
 * @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":2688
 * 
 * @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_261take_1d_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_261take_1d_object_object = {"take_1d_object_object", (PyCFunction)__pyx_pw_6pandas_5algos_261take_1d_object_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_261take_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__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_1d_object_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2688; __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 = 2688; __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 = 2688; __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 = 2688; __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 = 2688; __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 = 2689; __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 = 2690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_260take_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_260take_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 = 2688; __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 = 2688; __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 = 2688; __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":2696
 *         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 = 2696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/generated.pyx":2698
 *     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":2699
 * 
 *     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":2700
 *     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 = 2700; __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":2701
 *     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":2702
 *         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 = 2702; __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":2704
 *             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 = 2704; __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 = 2704; __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":2688
 * 
 * @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":2709
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_bool_bool_memview(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     uint8_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_bool_bool_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_bool_bool_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__163;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5numpy_uint8_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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_bool_bool_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":2717
 *         uint8_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 2717; __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 = 2717; __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":2718
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":2720
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_3 = __Pyx_PyInt_As_npy_uint8(__pyx_v_fill_value); if (unlikely((__pyx_t_3 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_3;

  /* "pandas/src/generated.pyx":2728
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(uint8_t) and
 *             sizeof(uint8_t) * n >= 256):
 */
  __pyx_t_5 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":2729
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(uint8_t) and             # <<<<<<<<<<<<<<
 *             sizeof(uint8_t) * n >= 256):
 * 
 */
  __pyx_t_5 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":2730
 *         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_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":2732
 *             sizeof(uint8_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_2 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":2733
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_6 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":2734
 *             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":2735
 *                 idx = indexer[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":2736
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_8 = __pyx_v_i;
          __pyx_t_9 = __pyx_v_j;
          *((__pyx_t_5numpy_uint8_t *) ( /* 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_v_fv;
        }
        goto __pyx_L9;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":2738
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(uint8_t) * k))
 */
        __pyx_t_7 = __pyx_v_idx;
        __pyx_t_10 = 0;
        __pyx_v_v = (&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_7 * __pyx_v_values.strides[0]) ) + __pyx_t_10 * __pyx_v_values.strides[1]) ))));

        /* "pandas/src/generated.pyx":2739
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(uint8_t) * k))
 *             return
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_11 * __pyx_v_out.strides[0]) ) + __pyx_t_12 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":2740
 *                     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_L9:;
    }

    /* "pandas/src/generated.pyx":2741
 *                     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":2743
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2744
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_13 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":2745
 *     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":2746
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_14 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_14; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2747
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L14;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2749
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_14 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_14; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2750
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_17 = __pyx_v_idx;
        __pyx_t_18 = __pyx_v_j;
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) ) + __pyx_t_20 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_17 * __pyx_v_values.strides[0]) ) + __pyx_t_18 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L14:;
  }

  /* "pandas/src/generated.pyx":2709
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_bool_bool_memview(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_bool_bool_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2756
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_bool_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_263take_2d_axis0_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_263take_2d_axis0_bool_bool = {"take_2d_axis0_bool_bool", (PyCFunction)__pyx_pw_6pandas_5algos_263take_2d_axis0_bool_bool, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_263take_2d_axis0_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__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_axis0_bool_bool", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2756; __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 = 2756; __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 = 2756; __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 = __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 = 2758; __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 = 2756; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2756; __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 = 2757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_262take_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_262take_2d_axis0_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_bool_bool_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  __pyx_t_5numpy_uint8_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;
  long __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  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("take_2d_axis0_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_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 = 2756; __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_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 = 2756; __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":2760
 *                                     uint8_t[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_bool_bool_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2760; __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[2]; __pyx_lineno = 2760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":2762
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_bool_bool_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":2763
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_bool_bool_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_bool_bool_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":2764
 *         take_2d_axis0_bool_bool_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":2773
 *         uint8_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":2774
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":2776
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_8 = __Pyx_PyInt_As_npy_uint8(__pyx_v_fill_value); if (unlikely((__pyx_t_8 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_8;

  /* "pandas/src/generated.pyx":2784
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(uint8_t) and
 *             sizeof(uint8_t) * n >= 256):
 */
  __pyx_t_9 = (((__pyx_v_values->strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_3 = __pyx_t_9;
    goto __pyx_L5_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":2785
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(uint8_t) and             # <<<<<<<<<<<<<<
 *             sizeof(uint8_t) * n >= 256):
 * 
 */
  __pyx_t_9 = (((__pyx_v_values->strides[1]) == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_3 = __pyx_t_9;
    goto __pyx_L5_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":2786
 *         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_9 = ((((sizeof(__pyx_t_5numpy_uint8_t)) * __pyx_v_n) >= 256) != 0);
  __pyx_t_3 = __pyx_t_9;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":2788
 *             sizeof(uint8_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_7 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":2789
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_10 = __pyx_v_i;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":2790
 *             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":2791
 *                 idx = indexer[i]
 *                 if idx == -1:
 *                     for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                         out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_k;
        for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_11; __pyx_v_j++) {

          /* "pandas/src/generated.pyx":2792
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *((__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]) )) = __pyx_v_fv;
        }
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":2794
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(uint8_t) * k))
 */
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_14 = 0;
        __pyx_v_v = (&(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides)));

        /* "pandas/src/generated.pyx":2795
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(uint8_t) * k))
 *             return
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":2796
 *                     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_L10:;
    }

    /* "pandas/src/generated.pyx":2797
 *                     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":2799
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2800
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":2801
 *     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":2802
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_18 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_18; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2803
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) ) + __pyx_t_20 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L15;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2805
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_18 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_18; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2806
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_21 = __pyx_v_idx;
        __pyx_t_22 = __pyx_v_j;
        __pyx_t_23 = __pyx_v_i;
        __pyx_t_24 = __pyx_v_j;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_23 * __pyx_v_out.strides[0]) ) + __pyx_t_24 * __pyx_v_out.strides[1]) )) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_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_L15:;
  }

  /* "pandas/src/generated.pyx":2756
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_bool_bool(ndarray[uint8_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2810
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_bool_object_memview(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     object[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_bool_object_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_bool_object_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__165;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_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;
  PyObject **__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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_bool_object_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":2818
 *         object fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 2818; __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 = 2818; __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":2819
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":2821
 *     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":2844
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2845
 * 
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_3 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":2846
 *     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":2847
 *         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":2848
 *         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_8 = ((PyObject * *) ( /* 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_GOTREF(*__pyx_t_8);
        __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_8);
        *__pyx_t_8 = __pyx_v_fv;
        __Pyx_GIVEREF(*__pyx_t_8);
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2850
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = True if values[idx, j] > 0 else False
 * 
 */
      __pyx_t_5 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2851
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = True if values[idx, j] > 0 else 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_1 = Py_True;
        } else {
          __Pyx_INCREF(Py_False);
          __pyx_t_1 = Py_False;
        }
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        __pyx_t_8 = ((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_8);
        __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_8);
        *__pyx_t_8 = __pyx_t_1;
        __Pyx_GIVEREF(*__pyx_t_8);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":2810
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_bool_object_memview(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_bool_object_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2857
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_bool_object(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_265take_2d_axis0_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_265take_2d_axis0_bool_object = {"take_2d_axis0_bool_object", (PyCFunction)__pyx_pw_6pandas_5algos_265take_2d_axis0_bool_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_265take_2d_axis0_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__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_axis0_bool_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2857; __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 = 2857; __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 = 2857; __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 = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2859; __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 = 2857; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2857; __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 = 2858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_264take_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_264take_2d_axis0_bool_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_bool_object_memview __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;
  PyObject **__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("take_2d_axis0_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_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 = 2857; __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_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 = 2857; __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":2861
 *                                     object[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_bool_object_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2861; __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[2]; __pyx_lineno = 2861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":2863
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_bool_object_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":2864
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_bool_object_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_bool_object_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":2865
 *         take_2d_axis0_bool_object_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":2874
 *         object fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":2875
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":2877
 *     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":2900
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2901
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_8 = __pyx_v_i;
    __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":2902
 *     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":2903
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_9 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_9; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2904
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_12 = ((PyObject * *) ( /* 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_GOTREF(*__pyx_t_12);
        __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_12);
        *__pyx_t_12 = __pyx_v_fv;
        __Pyx_GIVEREF(*__pyx_t_12);
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2906
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = True if values[idx, j] > 0 else False
 * 
 */
      __pyx_t_9 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_9; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2907
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = True if values[idx, j] > 0 else False             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_13 = __pyx_v_idx;
        __pyx_t_14 = __pyx_v_j;
        if ((((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides)) > 0) != 0)) {
          __Pyx_INCREF(Py_True);
          __pyx_t_2 = Py_True;
        } else {
          __Pyx_INCREF(Py_False);
          __pyx_t_2 = Py_False;
        }
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        __pyx_t_12 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) ));
        __Pyx_GOTREF(*__pyx_t_12);
        __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_12);
        *__pyx_t_12 = __pyx_t_2;
        __Pyx_GIVEREF(*__pyx_t_12);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
    }
    __pyx_L6:;
  }

  /* "pandas/src/generated.pyx":2857
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_bool_object(ndarray[uint8_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_fv);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2911
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int8_int8_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int8_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int8_int8_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_int8_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__167;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5numpy_int8_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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_int8_int8_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":2919
 *         int8_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 2919; __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 = 2919; __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":2920
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":2922
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_3 = __Pyx_PyInt_As_npy_int8(__pyx_v_fill_value); if (unlikely((__pyx_t_3 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_3;

  /* "pandas/src/generated.pyx":2930
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(int8_t) and
 *             sizeof(int8_t) * n >= 256):
 */
  __pyx_t_5 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":2931
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(int8_t) and             # <<<<<<<<<<<<<<
 *             sizeof(int8_t) * n >= 256):
 * 
 */
  __pyx_t_5 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":2932
 *         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_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":2934
 *             sizeof(int8_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_2 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":2935
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_6 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":2936
 *             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":2937
 *                 idx = indexer[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":2938
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_8 = __pyx_v_i;
          __pyx_t_9 = __pyx_v_j;
          *((__pyx_t_5numpy_int8_t *) ( /* 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_v_fv;
        }
        goto __pyx_L9;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":2940
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int8_t) * k))
 */
        __pyx_t_7 = __pyx_v_idx;
        __pyx_t_10 = 0;
        __pyx_v_v = (&(*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_7 * __pyx_v_values.strides[0]) ) + __pyx_t_10 * __pyx_v_values.strides[1]) ))));

        /* "pandas/src/generated.pyx":2941
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(int8_t) * k))
 *             return
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_11 * __pyx_v_out.strides[0]) ) + __pyx_t_12 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":2942
 *                     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_L9:;
    }

    /* "pandas/src/generated.pyx":2943
 *                     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":2945
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":2946
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_13 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":2947
 *     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":2948
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_14 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_14; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2949
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L14;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":2951
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_14 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_14; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":2952
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_17 = __pyx_v_idx;
        __pyx_t_18 = __pyx_v_j;
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) ) + __pyx_t_20 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_17 * __pyx_v_values.strides[0]) ) + __pyx_t_18 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L14:;
  }

  /* "pandas/src/generated.pyx":2911
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int8_int8_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int8_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":2958
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int8(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_267take_2d_axis0_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_267take_2d_axis0_int8_int8 = {"take_2d_axis0_int8_int8", (PyCFunction)__pyx_pw_6pandas_5algos_267take_2d_axis0_int8_int8, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_267take_2d_axis0_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__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_axis0_int8_int8", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2958; __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 = 2958; __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 = 2958; __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 = __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 = 2960; __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 = 2958; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2958; __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 = 2959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_266take_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_266take_2d_axis0_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_int8_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  __pyx_t_5numpy_int8_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;
  long __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  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("take_2d_axis0_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_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 = 2958; __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_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 = 2958; __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":2962
 *                                     int8_t[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int8_int8_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2962; __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[2]; __pyx_lineno = 2962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":2964
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int8_int8_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":2965
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int8_int8_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_int8_int8_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":2966
 *         take_2d_axis0_int8_int8_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":2975
 *         int8_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":2976
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":2978
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_8 = __Pyx_PyInt_As_npy_int8(__pyx_v_fill_value); if (unlikely((__pyx_t_8 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_8;

  /* "pandas/src/generated.pyx":2986
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(int8_t) and
 *             sizeof(int8_t) * n >= 256):
 */
  __pyx_t_9 = (((__pyx_v_values->strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_3 = __pyx_t_9;
    goto __pyx_L5_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":2987
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(int8_t) and             # <<<<<<<<<<<<<<
 *             sizeof(int8_t) * n >= 256):
 * 
 */
  __pyx_t_9 = (((__pyx_v_values->strides[1]) == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_3 = __pyx_t_9;
    goto __pyx_L5_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":2988
 *         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_9 = ((((sizeof(__pyx_t_5numpy_int8_t)) * __pyx_v_n) >= 256) != 0);
  __pyx_t_3 = __pyx_t_9;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":2990
 *             sizeof(int8_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_7 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":2991
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_10 = __pyx_v_i;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":2992
 *             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":2993
 *                 idx = indexer[i]
 *                 if idx == -1:
 *                     for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                         out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_k;
        for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_11; __pyx_v_j++) {

          /* "pandas/src/generated.pyx":2994
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *((__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]) )) = __pyx_v_fv;
        }
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":2996
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int8_t) * k))
 */
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_14 = 0;
        __pyx_v_v = (&(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides)));

        /* "pandas/src/generated.pyx":2997
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(int8_t) * k))
 *             return
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":2998
 *                     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_L10:;
    }

    /* "pandas/src/generated.pyx":2999
 *                     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":3001
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3002
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3003
 *     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":3004
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_18 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_18; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3005
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) ) + __pyx_t_20 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L15;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3007
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_18 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_18; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3008
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_21 = __pyx_v_idx;
        __pyx_t_22 = __pyx_v_j;
        __pyx_t_23 = __pyx_v_i;
        __pyx_t_24 = __pyx_v_j;
        *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_23 * __pyx_v_out.strides[0]) ) + __pyx_t_24 * __pyx_v_out.strides[1]) )) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_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_L15:;
  }

  /* "pandas/src/generated.pyx":2958
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int8(ndarray[int8_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3012
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int8_int32_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int8_int32_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_int32_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__169;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5numpy_int32_t __pyx_t_3;
  Py_ssize_t __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;
  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_int8_int32_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":3020
 *         int32_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 3020; __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 = 3020; __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":3021
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3023
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_3;

  /* "pandas/src/generated.pyx":3046
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3047
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_4 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":3048
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":3049
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3050
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_7 * __pyx_v_out.strides[0]) ) + __pyx_t_8 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3052
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3053
 *         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_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* 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_t_5numpy_int8_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]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":3012
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int8_int32_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int32_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3059
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int32(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_269take_2d_axis0_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_269take_2d_axis0_int8_int32 = {"take_2d_axis0_int8_int32", (PyCFunction)__pyx_pw_6pandas_5algos_269take_2d_axis0_int8_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_269take_2d_axis0_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__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_axis0_int8_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3059; __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 = 3059; __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 = 3059; __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 = __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 = 3061; __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 = 3059; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3059; __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 = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_268take_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_268take_2d_axis0_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_int32_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  __pyx_t_5numpy_int32_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_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_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 = 3059; __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_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 = 3059; __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":3063
 *                                     int32_t[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int8_int32_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3063; __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[2]; __pyx_lineno = 3063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":3065
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int8_int32_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":3066
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int8_int32_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_int8_int32_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":3067
 *         take_2d_axis0_int8_int32_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3076
 *         int32_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":3077
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":3079
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_8 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_8 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_8;

  /* "pandas/src/generated.pyx":3102
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3103
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3104
 *     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":3105
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3106
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* 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_v_fv;
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3108
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3109
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_13 = __pyx_v_idx;
        __pyx_t_14 = __pyx_v_j;
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) )) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides));
      }
    }
    __pyx_L6:;
  }

  /* "pandas/src/generated.pyx":3059
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int32(ndarray[int8_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3113
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int8_int64_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int8_int64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_int64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__171;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5numpy_int64_t __pyx_t_3;
  Py_ssize_t __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;
  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_int8_int64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":3121
 *         int64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 3121; __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 = 3121; __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":3122
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3124
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_3;

  /* "pandas/src/generated.pyx":3147
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3148
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_4 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":3149
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":3150
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3151
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_7 * __pyx_v_out.strides[0]) ) + __pyx_t_8 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3153
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3154
 *         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_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* 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_t_5numpy_int8_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]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":3113
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int8_int64_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3160
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_271take_2d_axis0_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_271take_2d_axis0_int8_int64 = {"take_2d_axis0_int8_int64", (PyCFunction)__pyx_pw_6pandas_5algos_271take_2d_axis0_int8_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_271take_2d_axis0_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__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_axis0_int8_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3160; __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 = 3160; __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 = 3160; __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 = __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 = 3162; __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 = 3160; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3160; __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 = 3161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_270take_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_270take_2d_axis0_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_int64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  __pyx_t_5numpy_int64_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_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_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 = 3160; __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_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 = 3160; __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":3164
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int8_int64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3164; __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[2]; __pyx_lineno = 3164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":3166
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int8_int64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":3167
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int8_int64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_int8_int64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":3168
 *         take_2d_axis0_int8_int64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3177
 *         int64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":3178
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":3180
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_8;

  /* "pandas/src/generated.pyx":3203
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3204
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3205
 *     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":3206
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3207
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* 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_v_fv;
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3209
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3210
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_13 = __pyx_v_idx;
        __pyx_t_14 = __pyx_v_j;
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) )) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides));
      }
    }
    __pyx_L6:;
  }

  /* "pandas/src/generated.pyx":3160
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int64(ndarray[int8_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3214
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int8_float64_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int8_float64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_float64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__173;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5numpy_float64_t __pyx_t_3;
  Py_ssize_t __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;
  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_int8_float64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":3222
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 3222; __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 = 3222; __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":3223
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3225
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_3 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_3;

  /* "pandas/src/generated.pyx":3248
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3249
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_4 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":3250
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":3251
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3252
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_7 * __pyx_v_out.strides[0]) ) + __pyx_t_8 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3254
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3255
 *         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_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* 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_t_5numpy_int8_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]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":3214
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int8_float64_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_float64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3261
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_float64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_273take_2d_axis0_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_273take_2d_axis0_int8_float64 = {"take_2d_axis0_int8_float64", (PyCFunction)__pyx_pw_6pandas_5algos_273take_2d_axis0_int8_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_273take_2d_axis0_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__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_axis0_int8_float64", 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_int8_float64", 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_int8_float64") < 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 = ((PyArrayObject *)values[0]);
    __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 = 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_int8_float64", 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_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 = 3261; __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 = 3262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_272take_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_272take_2d_axis0_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int8_float64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  __pyx_t_5numpy_float64_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_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_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 = 3261; __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_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":3265
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int8_float64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3265; __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[2]; __pyx_lineno = 3265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":3267
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int8_float64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":3268
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int8_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_int8_float64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":3269
 *         take_2d_axis0_int8_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3278
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":3279
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":3281
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_8 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_8;

  /* "pandas/src/generated.pyx":3304
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3305
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3306
 *     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":3307
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3308
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* 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_v_fv;
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3310
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3311
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_13 = __pyx_v_idx;
        __pyx_t_14 = __pyx_v_j;
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) )) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides));
      }
    }
    __pyx_L6:;
  }

  /* "pandas/src/generated.pyx":3261
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_float64(ndarray[int8_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3315
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int16_int16_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int16_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int16_int16_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_int16_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__175;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5numpy_int16_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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_int16_int16_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":3323
 *         int16_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 3323; __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 = 3323; __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":3324
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3326
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_3 = __Pyx_PyInt_As_npy_int16(__pyx_v_fill_value); if (unlikely((__pyx_t_3 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_3;

  /* "pandas/src/generated.pyx":3334
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(int16_t) and
 *             sizeof(int16_t) * n >= 256):
 */
  __pyx_t_5 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":3335
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(int16_t) and             # <<<<<<<<<<<<<<
 *             sizeof(int16_t) * n >= 256):
 * 
 */
  __pyx_t_5 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":3336
 *         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_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":3338
 *             sizeof(int16_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_2 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":3339
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_6 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":3340
 *             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":3341
 *                 idx = indexer[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":3342
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_8 = __pyx_v_i;
          __pyx_t_9 = __pyx_v_j;
          *((__pyx_t_5numpy_int16_t *) ( /* 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_v_fv;
        }
        goto __pyx_L9;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3344
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int16_t) * k))
 */
        __pyx_t_7 = __pyx_v_idx;
        __pyx_t_10 = 0;
        __pyx_v_v = (&(*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_7 * __pyx_v_values.strides[0]) ) + __pyx_t_10 * __pyx_v_values.strides[1]) ))));

        /* "pandas/src/generated.pyx":3345
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(int16_t) * k))
 *             return
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_11 * __pyx_v_out.strides[0]) ) + __pyx_t_12 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":3346
 *                     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_L9:;
    }

    /* "pandas/src/generated.pyx":3347
 *                     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":3349
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3350
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_13 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":3351
 *     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":3352
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_14 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_14; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3353
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L14;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3355
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_14 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_14; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3356
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_17 = __pyx_v_idx;
        __pyx_t_18 = __pyx_v_j;
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) ) + __pyx_t_20 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_17 * __pyx_v_values.strides[0]) ) + __pyx_t_18 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L14:;
  }

  /* "pandas/src/generated.pyx":3315
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int16_int16_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int16_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3362
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int16(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_275take_2d_axis0_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_275take_2d_axis0_int16_int16 = {"take_2d_axis0_int16_int16", (PyCFunction)__pyx_pw_6pandas_5algos_275take_2d_axis0_int16_int16, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_275take_2d_axis0_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__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_axis0_int16_int16", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3362; __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 = 3362; __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 = 3362; __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 = __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 = 3364; __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 = 3362; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3362; __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 = 3363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_274take_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_274take_2d_axis0_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_int16_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  __pyx_t_5numpy_int16_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;
  long __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  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("take_2d_axis0_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_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 = 3362; __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_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 = 3362; __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":3366
 *                                     int16_t[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int16_int16_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3366; __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[2]; __pyx_lineno = 3366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":3368
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int16_int16_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":3369
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int16_int16_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_int16_int16_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":3370
 *         take_2d_axis0_int16_int16_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3379
 *         int16_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":3380
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":3382
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_8 = __Pyx_PyInt_As_npy_int16(__pyx_v_fill_value); if (unlikely((__pyx_t_8 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_8;

  /* "pandas/src/generated.pyx":3390
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(int16_t) and
 *             sizeof(int16_t) * n >= 256):
 */
  __pyx_t_9 = (((__pyx_v_values->strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_3 = __pyx_t_9;
    goto __pyx_L5_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":3391
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(int16_t) and             # <<<<<<<<<<<<<<
 *             sizeof(int16_t) * n >= 256):
 * 
 */
  __pyx_t_9 = (((__pyx_v_values->strides[1]) == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_3 = __pyx_t_9;
    goto __pyx_L5_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":3392
 *         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_9 = ((((sizeof(__pyx_t_5numpy_int16_t)) * __pyx_v_n) >= 256) != 0);
  __pyx_t_3 = __pyx_t_9;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":3394
 *             sizeof(int16_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_7 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":3395
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_10 = __pyx_v_i;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3396
 *             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":3397
 *                 idx = indexer[i]
 *                 if idx == -1:
 *                     for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                         out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_k;
        for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_11; __pyx_v_j++) {

          /* "pandas/src/generated.pyx":3398
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *((__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]) )) = __pyx_v_fv;
        }
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3400
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int16_t) * k))
 */
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_14 = 0;
        __pyx_v_v = (&(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides)));

        /* "pandas/src/generated.pyx":3401
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(int16_t) * k))
 *             return
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":3402
 *                     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_L10:;
    }

    /* "pandas/src/generated.pyx":3403
 *                     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":3405
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3406
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3407
 *     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":3408
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_18 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_18; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3409
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) ) + __pyx_t_20 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L15;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3411
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_18 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_18; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3412
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_21 = __pyx_v_idx;
        __pyx_t_22 = __pyx_v_j;
        __pyx_t_23 = __pyx_v_i;
        __pyx_t_24 = __pyx_v_j;
        *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_23 * __pyx_v_out.strides[0]) ) + __pyx_t_24 * __pyx_v_out.strides[1]) )) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_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_L15:;
  }

  /* "pandas/src/generated.pyx":3362
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int16(ndarray[int16_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3416
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int16_int32_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int16_int32_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_int32_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__177;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5numpy_int32_t __pyx_t_3;
  Py_ssize_t __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;
  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_int16_int32_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":3424
 *         int32_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 3424; __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 = 3424; __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":3425
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3427
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_3;

  /* "pandas/src/generated.pyx":3450
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3451
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_4 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":3452
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":3453
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3454
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_7 * __pyx_v_out.strides[0]) ) + __pyx_t_8 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3456
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3457
 *         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_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* 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_t_5numpy_int16_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]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":3416
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int16_int32_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int32_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3463
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int32(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_277take_2d_axis0_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_277take_2d_axis0_int16_int32 = {"take_2d_axis0_int16_int32", (PyCFunction)__pyx_pw_6pandas_5algos_277take_2d_axis0_int16_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_277take_2d_axis0_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__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_axis0_int16_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3463; __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 = 3463; __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 = 3463; __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 = __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 = 3465; __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 = 3463; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3463; __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 = 3464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_276take_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_276take_2d_axis0_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_int32_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  __pyx_t_5numpy_int32_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_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_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 = 3463; __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_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 = 3463; __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":3467
 *                                     int32_t[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int16_int32_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3467; __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[2]; __pyx_lineno = 3467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":3469
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int16_int32_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":3470
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int16_int32_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_int16_int32_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":3471
 *         take_2d_axis0_int16_int32_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3480
 *         int32_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":3481
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":3483
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_8 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_8 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_8;

  /* "pandas/src/generated.pyx":3506
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3507
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3508
 *     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":3509
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3510
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* 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_v_fv;
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3512
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3513
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_13 = __pyx_v_idx;
        __pyx_t_14 = __pyx_v_j;
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) )) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides));
      }
    }
    __pyx_L6:;
  }

  /* "pandas/src/generated.pyx":3463
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int32(ndarray[int16_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3517
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int16_int64_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int16_int64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_int64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__179;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5numpy_int64_t __pyx_t_3;
  Py_ssize_t __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;
  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_int16_int64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":3525
 *         int64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 3525; __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 = 3525; __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":3526
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3528
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_3;

  /* "pandas/src/generated.pyx":3551
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3552
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_4 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":3553
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":3554
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3555
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_7 * __pyx_v_out.strides[0]) ) + __pyx_t_8 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3557
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3558
 *         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_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* 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_t_5numpy_int16_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]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":3517
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int16_int64_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3564
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_279take_2d_axis0_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_279take_2d_axis0_int16_int64 = {"take_2d_axis0_int16_int64", (PyCFunction)__pyx_pw_6pandas_5algos_279take_2d_axis0_int16_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_279take_2d_axis0_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__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_axis0_int16_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3564; __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 = 3564; __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 = 3564; __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 = __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 = 3566; __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 = 3564; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3564; __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 = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_278take_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_278take_2d_axis0_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_int64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  __pyx_t_5numpy_int64_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_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_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 = 3564; __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_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 = 3564; __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":3568
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int16_int64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3568; __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[2]; __pyx_lineno = 3568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":3570
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int16_int64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":3571
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int16_int64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_int16_int64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":3572
 *         take_2d_axis0_int16_int64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3581
 *         int64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":3582
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":3584
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_8;

  /* "pandas/src/generated.pyx":3607
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3608
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3609
 *     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":3610
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3611
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* 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_v_fv;
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3613
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3614
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_13 = __pyx_v_idx;
        __pyx_t_14 = __pyx_v_j;
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) )) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides));
      }
    }
    __pyx_L6:;
  }

  /* "pandas/src/generated.pyx":3564
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int64(ndarray[int16_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3618
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int16_float64_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int16_float64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_float64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__181;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5numpy_float64_t __pyx_t_3;
  Py_ssize_t __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;
  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_int16_float64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":3626
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 3626; __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 = 3626; __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":3627
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3629
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_3 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_3;

  /* "pandas/src/generated.pyx":3652
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3653
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_4 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":3654
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":3655
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3656
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_7 * __pyx_v_out.strides[0]) ) + __pyx_t_8 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3658
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3659
 *         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_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* 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_t_5numpy_int16_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]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":3618
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int16_float64_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_float64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3665
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_float64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_281take_2d_axis0_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_281take_2d_axis0_int16_float64 = {"take_2d_axis0_int16_float64", (PyCFunction)__pyx_pw_6pandas_5algos_281take_2d_axis0_int16_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_281take_2d_axis0_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__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_axis0_int16_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3665; __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 = 3665; __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 = 3665; __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 = __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 = 3667; __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 = 3665; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3665; __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 = 3666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_280take_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_280take_2d_axis0_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int16_float64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  __pyx_t_5numpy_float64_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_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_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 = 3665; __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_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 = 3665; __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":3669
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int16_float64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3669; __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[2]; __pyx_lineno = 3669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":3671
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int16_float64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":3672
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int16_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_int16_float64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":3673
 *         take_2d_axis0_int16_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3682
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":3683
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":3685
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_8 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_8;

  /* "pandas/src/generated.pyx":3708
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3709
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3710
 *     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":3711
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3712
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* 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_v_fv;
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3714
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3715
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_13 = __pyx_v_idx;
        __pyx_t_14 = __pyx_v_j;
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) )) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides));
      }
    }
    __pyx_L6:;
  }

  /* "pandas/src/generated.pyx":3665
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_float64(ndarray[int16_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3719
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int32_int32_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int32_int32_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int32_int32_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__183;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5numpy_int32_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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_int32_int32_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":3727
 *         int32_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 3727; __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 = 3727; __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":3728
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3730
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_3;

  /* "pandas/src/generated.pyx":3738
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(int32_t) and
 *             sizeof(int32_t) * n >= 256):
 */
  __pyx_t_5 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":3739
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(int32_t) and             # <<<<<<<<<<<<<<
 *             sizeof(int32_t) * n >= 256):
 * 
 */
  __pyx_t_5 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":3740
 *         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_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":3742
 *             sizeof(int32_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_2 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":3743
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_6 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":3744
 *             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":3745
 *                 idx = indexer[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":3746
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_8 = __pyx_v_i;
          __pyx_t_9 = __pyx_v_j;
          *((__pyx_t_5numpy_int32_t *) ( /* 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_v_fv;
        }
        goto __pyx_L9;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3748
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int32_t) * k))
 */
        __pyx_t_7 = __pyx_v_idx;
        __pyx_t_10 = 0;
        __pyx_v_v = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_7 * __pyx_v_values.strides[0]) ) + __pyx_t_10 * __pyx_v_values.strides[1]) ))));

        /* "pandas/src/generated.pyx":3749
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(int32_t) * k))
 *             return
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_11 * __pyx_v_out.strides[0]) ) + __pyx_t_12 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":3750
 *                     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_L9:;
    }

    /* "pandas/src/generated.pyx":3751
 *                     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":3753
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3754
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_13 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":3755
 *     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":3756
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_14 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_14; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3757
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L14;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3759
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_14 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_14; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3760
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_17 = __pyx_v_idx;
        __pyx_t_18 = __pyx_v_j;
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) ) + __pyx_t_20 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_17 * __pyx_v_values.strides[0]) ) + __pyx_t_18 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L14:;
  }

  /* "pandas/src/generated.pyx":3719
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int32_int32_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_int32_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3766
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_283take_2d_axis0_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_283take_2d_axis0_int32_int32 = {"take_2d_axis0_int32_int32", (PyCFunction)__pyx_pw_6pandas_5algos_283take_2d_axis0_int32_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_283take_2d_axis0_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__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_axis0_int32_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3766; __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 = 3766; __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 = 3766; __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 = __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 = 3768; __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 = 3766; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3766; __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 = 3767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_282take_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_282take_2d_axis0_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int32_int32_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  __pyx_t_5numpy_int32_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;
  long __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  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("take_2d_axis0_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_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 = 3766; __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_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 = 3766; __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":3770
 *                                     int32_t[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int32_int32_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3770; __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[2]; __pyx_lineno = 3770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":3772
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int32_int32_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":3773
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int32_int32_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_int32_int32_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":3774
 *         take_2d_axis0_int32_int32_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3783
 *         int32_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":3784
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":3786
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_8 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_8 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_8;

  /* "pandas/src/generated.pyx":3794
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(int32_t) and
 *             sizeof(int32_t) * n >= 256):
 */
  __pyx_t_9 = (((__pyx_v_values->strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_3 = __pyx_t_9;
    goto __pyx_L5_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":3795
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(int32_t) and             # <<<<<<<<<<<<<<
 *             sizeof(int32_t) * n >= 256):
 * 
 */
  __pyx_t_9 = (((__pyx_v_values->strides[1]) == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_3 = __pyx_t_9;
    goto __pyx_L5_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":3796
 *         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_9 = ((((sizeof(__pyx_t_5numpy_int32_t)) * __pyx_v_n) >= 256) != 0);
  __pyx_t_3 = __pyx_t_9;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":3798
 *             sizeof(int32_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_7 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":3799
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_10 = __pyx_v_i;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":3800
 *             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":3801
 *                 idx = indexer[i]
 *                 if idx == -1:
 *                     for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                         out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_k;
        for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_11; __pyx_v_j++) {

          /* "pandas/src/generated.pyx":3802
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *((__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]) )) = __pyx_v_fv;
        }
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":3804
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int32_t) * k))
 */
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_14 = 0;
        __pyx_v_v = (&(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides)));

        /* "pandas/src/generated.pyx":3805
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(int32_t) * k))
 *             return
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":3806
 *                     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_L10:;
    }

    /* "pandas/src/generated.pyx":3807
 *                     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":3809
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3810
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3811
 *     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":3812
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_18 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_18; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3813
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) ) + __pyx_t_20 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L15;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3815
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_18 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_18; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3816
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_21 = __pyx_v_idx;
        __pyx_t_22 = __pyx_v_j;
        __pyx_t_23 = __pyx_v_i;
        __pyx_t_24 = __pyx_v_j;
        *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_23 * __pyx_v_out.strides[0]) ) + __pyx_t_24 * __pyx_v_out.strides[1]) )) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_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_L15:;
  }

  /* "pandas/src/generated.pyx":3766
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_int32(ndarray[int32_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3820
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int32_int64_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int32_int64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int32_int64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__185;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5numpy_int64_t __pyx_t_3;
  Py_ssize_t __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;
  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_int32_int64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":3828
 *         int64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 3828; __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 = 3828; __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":3829
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3831
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_3;

  /* "pandas/src/generated.pyx":3854
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3855
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_4 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":3856
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":3857
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3858
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_7 * __pyx_v_out.strides[0]) ) + __pyx_t_8 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3860
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3861
 *         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_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* 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_t_5numpy_int32_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]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":3820
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int32_int64_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_int64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3867
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_int64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_285take_2d_axis0_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_285take_2d_axis0_int32_int64 = {"take_2d_axis0_int32_int64", (PyCFunction)__pyx_pw_6pandas_5algos_285take_2d_axis0_int32_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_285take_2d_axis0_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__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_axis0_int32_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3867; __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 = 3867; __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 = 3867; __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 = __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 = 3869; __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 = 3867; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3867; __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 = 3868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_284take_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_284take_2d_axis0_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int32_int64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  __pyx_t_5numpy_int64_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_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_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 = 3867; __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_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 = 3867; __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":3871
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int32_int64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3871; __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[2]; __pyx_lineno = 3871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":3873
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int32_int64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":3874
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int32_int64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_int32_int64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":3875
 *         take_2d_axis0_int32_int64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3884
 *         int64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":3885
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":3887
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_8;

  /* "pandas/src/generated.pyx":3910
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3911
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":3912
 *     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":3913
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3914
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* 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_v_fv;
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3916
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3917
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_13 = __pyx_v_idx;
        __pyx_t_14 = __pyx_v_j;
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) )) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides));
      }
    }
    __pyx_L6:;
  }

  /* "pandas/src/generated.pyx":3867
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_int64(ndarray[int32_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3921
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int32_float64_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int32_float64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int32_float64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__187;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5numpy_float64_t __pyx_t_3;
  Py_ssize_t __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;
  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_int32_float64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":3929
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 3929; __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 = 3929; __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":3930
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":3932
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_3 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_3;

  /* "pandas/src/generated.pyx":3955
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":3956
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_4 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":3957
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":3958
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3959
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_7 * __pyx_v_out.strides[0]) ) + __pyx_t_8 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":3961
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":3962
 *         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_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* 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_t_5numpy_int32_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]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":3921
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int32_float64_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_float64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":3968
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_float64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_287take_2d_axis0_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_287take_2d_axis0_int32_float64 = {"take_2d_axis0_int32_float64", (PyCFunction)__pyx_pw_6pandas_5algos_287take_2d_axis0_int32_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_287take_2d_axis0_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__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_axis0_int32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3968; __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 = 3968; __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 = 3968; __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 = __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 = 3970; __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 = 3968; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3968; __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 = 3969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_286take_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_286take_2d_axis0_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int32_float64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  __pyx_t_5numpy_float64_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_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_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 = 3968; __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_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 = 3968; __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":3972
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int32_float64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3972; __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[2]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":3974
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int32_float64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":3975
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int32_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_int32_float64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":3976
 *         take_2d_axis0_int32_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":3985
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":3986
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":3988
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_8 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_8;

  /* "pandas/src/generated.pyx":4011
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4012
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4013
 *     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":4014
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4015
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* 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_v_fv;
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4017
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4018
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_13 = __pyx_v_idx;
        __pyx_t_14 = __pyx_v_j;
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) )) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides));
      }
    }
    __pyx_L6:;
  }

  /* "pandas/src/generated.pyx":3968
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_float64(ndarray[int32_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4022
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int64_int64_memview(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int64_int64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int64_int64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__189;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5numpy_int64_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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_int64_int64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":4030
 *         int64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 4030; __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 = 4030; __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":4031
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":4033
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_3;

  /* "pandas/src/generated.pyx":4041
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(int64_t) and
 *             sizeof(int64_t) * n >= 256):
 */
  __pyx_t_5 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":4042
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(int64_t) and             # <<<<<<<<<<<<<<
 *             sizeof(int64_t) * n >= 256):
 * 
 */
  __pyx_t_5 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":4043
 *         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_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":4045
 *             sizeof(int64_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_2 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":4046
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_6 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":4047
 *             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":4048
 *                 idx = indexer[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":4049
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_8 = __pyx_v_i;
          __pyx_t_9 = __pyx_v_j;
          *((__pyx_t_5numpy_int64_t *) ( /* 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_v_fv;
        }
        goto __pyx_L9;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4051
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int64_t) * k))
 */
        __pyx_t_7 = __pyx_v_idx;
        __pyx_t_10 = 0;
        __pyx_v_v = (&(*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_7 * __pyx_v_values.strides[0]) ) + __pyx_t_10 * __pyx_v_values.strides[1]) ))));

        /* "pandas/src/generated.pyx":4052
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(int64_t) * k))
 *             return
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_11 * __pyx_v_out.strides[0]) ) + __pyx_t_12 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":4053
 *                     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_L9:;
    }

    /* "pandas/src/generated.pyx":4054
 *                     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":4056
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4057
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_13 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":4058
 *     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":4059
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_14 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_14; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4060
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L14;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4062
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_14 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_14; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4063
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_17 = __pyx_v_idx;
        __pyx_t_18 = __pyx_v_j;
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) ) + __pyx_t_20 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_17 * __pyx_v_values.strides[0]) ) + __pyx_t_18 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L14:;
  }

  /* "pandas/src/generated.pyx":4022
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int64_int64_memview(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int64_int64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4069
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int64_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_289take_2d_axis0_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_289take_2d_axis0_int64_int64 = {"take_2d_axis0_int64_int64", (PyCFunction)__pyx_pw_6pandas_5algos_289take_2d_axis0_int64_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_289take_2d_axis0_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__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_axis0_int64_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4069; __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 = 4069; __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 = 4069; __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 = __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 = 4071; __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 = 4069; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4069; __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 = 4070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_288take_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_288take_2d_axis0_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int64_int64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  __pyx_t_5numpy_int64_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;
  long __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  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("take_2d_axis0_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_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 = 4069; __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_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 = 4069; __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":4073
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int64_int64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4073; __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[2]; __pyx_lineno = 4073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4075
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int64_int64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":4076
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int64_int64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_int64_int64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":4077
 *         take_2d_axis0_int64_int64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":4086
 *         int64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":4087
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":4089
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_8;

  /* "pandas/src/generated.pyx":4097
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(int64_t) and
 *             sizeof(int64_t) * n >= 256):
 */
  __pyx_t_9 = (((__pyx_v_values->strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_3 = __pyx_t_9;
    goto __pyx_L5_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":4098
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(int64_t) and             # <<<<<<<<<<<<<<
 *             sizeof(int64_t) * n >= 256):
 * 
 */
  __pyx_t_9 = (((__pyx_v_values->strides[1]) == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_3 = __pyx_t_9;
    goto __pyx_L5_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":4099
 *         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_9 = ((((sizeof(__pyx_t_5numpy_int64_t)) * __pyx_v_n) >= 256) != 0);
  __pyx_t_3 = __pyx_t_9;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4101
 *             sizeof(int64_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_7 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":4102
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_10 = __pyx_v_i;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":4103
 *             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":4104
 *                 idx = indexer[i]
 *                 if idx == -1:
 *                     for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                         out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_k;
        for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_11; __pyx_v_j++) {

          /* "pandas/src/generated.pyx":4105
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *((__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]) )) = __pyx_v_fv;
        }
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4107
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(int64_t) * k))
 */
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_14 = 0;
        __pyx_v_v = (&(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides)));

        /* "pandas/src/generated.pyx":4108
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(int64_t) * k))
 *             return
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":4109
 *                     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_L10:;
    }

    /* "pandas/src/generated.pyx":4110
 *                     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":4112
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4113
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4114
 *     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":4115
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_18 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_18; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4116
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) ) + __pyx_t_20 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L15;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4118
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_18 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_18; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4119
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_21 = __pyx_v_idx;
        __pyx_t_22 = __pyx_v_j;
        __pyx_t_23 = __pyx_v_i;
        __pyx_t_24 = __pyx_v_j;
        *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_23 * __pyx_v_out.strides[0]) ) + __pyx_t_24 * __pyx_v_out.strides[1]) )) = (*__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_L15:;
  }

  /* "pandas/src/generated.pyx":4069
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int64_int64(ndarray[int64_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4123
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int64_float64_memview(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_int64_float64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int64_float64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__191;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5numpy_float64_t __pyx_t_3;
  Py_ssize_t __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;
  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_int64_float64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":4131
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 4131; __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 = 4131; __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":4132
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":4134
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_3 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_3;

  /* "pandas/src/generated.pyx":4157
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4158
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_4 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":4159
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":4160
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4161
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_7 * __pyx_v_out.strides[0]) ) + __pyx_t_8 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4163
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4164
 *         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_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* 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_t_5numpy_int64_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]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4123
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_int64_float64_memview(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int64_float64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4170
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int64_float64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_291take_2d_axis0_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_291take_2d_axis0_int64_float64 = {"take_2d_axis0_int64_float64", (PyCFunction)__pyx_pw_6pandas_5algos_291take_2d_axis0_int64_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_291take_2d_axis0_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__192;
    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 = 4170; __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 = 4170; __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 = 4170; __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 = __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 = 4172; __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 = 4170; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4170; __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 = 4171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_290take_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_290take_2d_axis0_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_int64_float64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  __pyx_t_5numpy_float64_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_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_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 = 4170; __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_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 = 4170; __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":4174
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int64_float64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4174; __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[2]; __pyx_lineno = 4174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4176
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int64_float64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":4177
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_int64_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_int64_float64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":4178
 *         take_2d_axis0_int64_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":4187
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":4188
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":4190
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_8 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_8;

  /* "pandas/src/generated.pyx":4213
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4214
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4215
 *     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":4216
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4217
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* 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_v_fv;
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4219
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4220
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_13 = __pyx_v_idx;
        __pyx_t_14 = __pyx_v_j;
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) )) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides));
      }
    }
    __pyx_L6:;
  }

  /* "pandas/src/generated.pyx":4170
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int64_float64(ndarray[int64_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4224
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_float32_float32_memview(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float32_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_float32_float32_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_float32_float32_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__193;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5numpy_float32_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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_float32_float32_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":4232
 *         float32_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 4232; __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 = 4232; __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":4233
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":4235
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_fill_value); if (unlikely((__pyx_t_3 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_3;

  /* "pandas/src/generated.pyx":4243
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(float32_t) and
 *             sizeof(float32_t) * n >= 256):
 */
  __pyx_t_5 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":4244
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(float32_t) and             # <<<<<<<<<<<<<<
 *             sizeof(float32_t) * n >= 256):
 * 
 */
  __pyx_t_5 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_float32_t))) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":4245
 *         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_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":4247
 *             sizeof(float32_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_2 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":4248
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_6 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":4249
 *             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":4250
 *                 idx = indexer[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":4251
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_8 = __pyx_v_i;
          __pyx_t_9 = __pyx_v_j;
          *((__pyx_t_5numpy_float32_t *) ( /* 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_v_fv;
        }
        goto __pyx_L9;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4253
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(float32_t) * k))
 */
        __pyx_t_7 = __pyx_v_idx;
        __pyx_t_10 = 0;
        __pyx_v_v = (&(*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_7 * __pyx_v_values.strides[0]) ) + __pyx_t_10 * __pyx_v_values.strides[1]) ))));

        /* "pandas/src/generated.pyx":4254
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(float32_t) * k))
 *             return
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_11 * __pyx_v_out.strides[0]) ) + __pyx_t_12 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":4255
 *                     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_L9:;
    }

    /* "pandas/src/generated.pyx":4256
 *                     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":4258
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4259
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_13 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":4260
 *     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":4261
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_14 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_14; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4262
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L14;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4264
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_14 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_14; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4265
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_17 = __pyx_v_idx;
        __pyx_t_18 = __pyx_v_j;
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) ) + __pyx_t_20 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_17 * __pyx_v_values.strides[0]) ) + __pyx_t_18 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L14:;
  }

  /* "pandas/src/generated.pyx":4224
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_float32_float32_memview(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float32_float32_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4271
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float32_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_293take_2d_axis0_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_293take_2d_axis0_float32_float32 = {"take_2d_axis0_float32_float32", (PyCFunction)__pyx_pw_6pandas_5algos_293take_2d_axis0_float32_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_293take_2d_axis0_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__194;
    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 = 4271; __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 = 4271; __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 = 4271; __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 = __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 = 4273; __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 = 4271; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4271; __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 = 4272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_292take_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_292take_2d_axis0_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_float32_float32_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  __pyx_t_5numpy_float32_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;
  long __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  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("take_2d_axis0_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_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 = 4271; __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_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 = 4271; __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":4275
 *                                     float32_t[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_float32_float32_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4275; __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[2]; __pyx_lineno = 4275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4277
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_float32_float32_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":4278
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_float32_float32_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_float32_float32_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":4279
 *         take_2d_axis0_float32_float32_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":4288
 *         float32_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":4289
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":4291
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_v_fill_value); if (unlikely((__pyx_t_8 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_8;

  /* "pandas/src/generated.pyx":4299
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(float32_t) and
 *             sizeof(float32_t) * n >= 256):
 */
  __pyx_t_9 = (((__pyx_v_values->strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_3 = __pyx_t_9;
    goto __pyx_L5_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":4300
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(float32_t) and             # <<<<<<<<<<<<<<
 *             sizeof(float32_t) * n >= 256):
 * 
 */
  __pyx_t_9 = (((__pyx_v_values->strides[1]) == (sizeof(__pyx_t_5numpy_float32_t))) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_3 = __pyx_t_9;
    goto __pyx_L5_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":4301
 *         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_9 = ((((sizeof(__pyx_t_5numpy_float32_t)) * __pyx_v_n) >= 256) != 0);
  __pyx_t_3 = __pyx_t_9;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4303
 *             sizeof(float32_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_7 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":4304
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_10 = __pyx_v_i;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":4305
 *             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":4306
 *                 idx = indexer[i]
 *                 if idx == -1:
 *                     for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                         out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_k;
        for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_11; __pyx_v_j++) {

          /* "pandas/src/generated.pyx":4307
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *((__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]) )) = __pyx_v_fv;
        }
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4309
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(float32_t) * k))
 */
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_14 = 0;
        __pyx_v_v = (&(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides)));

        /* "pandas/src/generated.pyx":4310
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(float32_t) * k))
 *             return
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":4311
 *                     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_L10:;
    }

    /* "pandas/src/generated.pyx":4312
 *                     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":4314
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4315
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4316
 *     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":4317
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_18 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_18; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4318
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) ) + __pyx_t_20 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L15;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4320
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_18 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_18; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4321
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_21 = __pyx_v_idx;
        __pyx_t_22 = __pyx_v_j;
        __pyx_t_23 = __pyx_v_i;
        __pyx_t_24 = __pyx_v_j;
        *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_23 * __pyx_v_out.strides[0]) ) + __pyx_t_24 * __pyx_v_out.strides[1]) )) = (*__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));
      }
    }
    __pyx_L15:;
  }

  /* "pandas/src/generated.pyx":4271
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float32_float32(ndarray[float32_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4325
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_float32_float64_memview(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_float32_float64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_float32_float64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__195;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5numpy_float64_t __pyx_t_3;
  Py_ssize_t __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;
  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_float32_float64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":4333
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 4333; __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 = 4333; __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":4334
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":4336
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_3 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_3;

  /* "pandas/src/generated.pyx":4359
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4360
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_4 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":4361
 *     for i from 0 <= i < n:
 *         idx = indexer[i]
 *         if idx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv
 */
    __pyx_t_5 = ((__pyx_v_idx == -1) != 0);
    if (__pyx_t_5) {

      /* "pandas/src/generated.pyx":4362
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4363
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_7 * __pyx_v_out.strides[0]) ) + __pyx_t_8 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4365
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_6 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4366
 *         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_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* 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_t_5numpy_float32_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]) )));
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4325
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_float32_float64_memview(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float32_float64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4372
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float32_float64(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_295take_2d_axis0_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_295take_2d_axis0_float32_float64 = {"take_2d_axis0_float32_float64", (PyCFunction)__pyx_pw_6pandas_5algos_295take_2d_axis0_float32_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_295take_2d_axis0_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__196;
    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 = 4372; __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 = 4372; __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 = 4372; __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 = __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 = 4374; __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 = 4372; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4372; __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 = 4373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_294take_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_294take_2d_axis0_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_float32_float64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  __pyx_t_5numpy_float64_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_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_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 = 4372; __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_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 = 4372; __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":4376
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_float32_float64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4376; __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[2]; __pyx_lineno = 4376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4378
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_float32_float64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":4379
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_float32_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_float32_float64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":4380
 *         take_2d_axis0_float32_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":4389
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":4390
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":4392
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF False:
 */
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_8 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_8;

  /* "pandas/src/generated.pyx":4415
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4416
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4417
 *     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":4418
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4419
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* 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_v_fv;
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4421
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_10 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4422
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_13 = __pyx_v_idx;
        __pyx_t_14 = __pyx_v_j;
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) )) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides));
      }
    }
    __pyx_L6:;
  }

  /* "pandas/src/generated.pyx":4372
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float32_float64(ndarray[float32_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4426
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_float64_float64_memview(float64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_float64_float64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_float64_float64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__197;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __pyx_t_5numpy_float64_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;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_float64_float64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":4434
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 4434; __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 = 4434; __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":4435
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":4437
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_3 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_3;

  /* "pandas/src/generated.pyx":4445
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(float64_t) and
 *             sizeof(float64_t) * n >= 256):
 */
  __pyx_t_5 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":4446
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(float64_t) and             # <<<<<<<<<<<<<<
 *             sizeof(float64_t) * n >= 256):
 * 
 */
  __pyx_t_5 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_float64_t))) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":4447
 *         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_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":4449
 *             sizeof(float64_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_2 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":4450
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_6 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":4451
 *             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":4452
 *                 idx = indexer[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":4453
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_8 = __pyx_v_i;
          __pyx_t_9 = __pyx_v_j;
          *((__pyx_t_5numpy_float64_t *) ( /* 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_v_fv;
        }
        goto __pyx_L9;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4455
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(float64_t) * k))
 */
        __pyx_t_7 = __pyx_v_idx;
        __pyx_t_10 = 0;
        __pyx_v_v = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_7 * __pyx_v_values.strides[0]) ) + __pyx_t_10 * __pyx_v_values.strides[1]) ))));

        /* "pandas/src/generated.pyx":4456
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(float64_t) * k))
 *             return
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_11 * __pyx_v_out.strides[0]) ) + __pyx_t_12 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":4457
 *                     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_L9:;
    }

    /* "pandas/src/generated.pyx":4458
 *                     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":4460
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4461
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_13 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":4462
 *     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":4463
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_14 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_14; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4464
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L14;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4466
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_14 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_14; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4467
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_17 = __pyx_v_idx;
        __pyx_t_18 = __pyx_v_j;
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) ) + __pyx_t_20 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_17 * __pyx_v_values.strides[0]) ) + __pyx_t_18 * __pyx_v_values.strides[1]) )));
      }
    }
    __pyx_L14:;
  }

  /* "pandas/src/generated.pyx":4426
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_float64_float64_memview(float64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float64_float64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4473
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float64_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_297take_2d_axis0_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_297take_2d_axis0_float64_float64 = {"take_2d_axis0_float64_float64", (PyCFunction)__pyx_pw_6pandas_5algos_297take_2d_axis0_float64_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_297take_2d_axis0_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__198;
    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 = 4473; __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 = 4473; __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 = 4473; __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 = __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 = 4475; __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 = 4473; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4473; __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 = 4474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_296take_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_296take_2d_axis0_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_float64_float64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  __pyx_t_5numpy_float64_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;
  long __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  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("take_2d_axis0_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_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 = 4473; __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_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 = 4473; __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":4477
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_float64_float64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __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_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4477; __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[2]; __pyx_lineno = 4477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4479
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_float64_float64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":4480
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_float64_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_float64_float64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":4481
 *         take_2d_axis0_float64_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":4490
 *         float64_t fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":4491
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":4493
 *     k = values.shape[1]
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     IF True:
 */
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_8 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_8;

  /* "pandas/src/generated.pyx":4501
 * 
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and             # <<<<<<<<<<<<<<
 *             values.strides[1] == sizeof(float64_t) and
 *             sizeof(float64_t) * n >= 256):
 */
  __pyx_t_9 = (((__pyx_v_values->strides[1]) == (__pyx_v_out.strides[1])) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_3 = __pyx_t_9;
    goto __pyx_L5_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":4502
 *         #GH3130
 *         if (values.strides[1] == out.strides[1] and
 *             values.strides[1] == sizeof(float64_t) and             # <<<<<<<<<<<<<<
 *             sizeof(float64_t) * n >= 256):
 * 
 */
  __pyx_t_9 = (((__pyx_v_values->strides[1]) == (sizeof(__pyx_t_5numpy_float64_t))) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_3 = __pyx_t_9;
    goto __pyx_L5_bool_binop_done;
  }

  /* "pandas/src/generated.pyx":4503
 *         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_9 = ((((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_n) >= 256) != 0);
  __pyx_t_3 = __pyx_t_9;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4505
 *             sizeof(float64_t) * n >= 256):
 * 
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 idx = indexer[i]
 *                 if idx == -1:
 */
    __pyx_t_7 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

      /* "pandas/src/generated.pyx":4506
 * 
 *             for i from 0 <= i < n:
 *                 idx = indexer[i]             # <<<<<<<<<<<<<<
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 */
      __pyx_t_10 = __pyx_v_i;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":4507
 *             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":4508
 *                 idx = indexer[i]
 *                 if idx == -1:
 *                     for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                         out[i, j] = fv
 *                 else:
 */
        __pyx_t_11 = __pyx_v_k;
        for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_11; __pyx_v_j++) {

          /* "pandas/src/generated.pyx":4509
 *                 if idx == -1:
 *                     for j from 0 <= j < k:
 *                         out[i, j] = fv             # <<<<<<<<<<<<<<
 *                 else:
 *                     v = &values[idx, 0]
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          *((__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]) )) = __pyx_v_fv;
        }
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4511
 *                         out[i, j] = fv
 *                 else:
 *                     v = &values[idx, 0]             # <<<<<<<<<<<<<<
 *                     o = &out[i, 0]
 *                     memmove(o, v, <size_t>(sizeof(float64_t) * k))
 */
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_14 = 0;
        __pyx_v_v = (&(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides)));

        /* "pandas/src/generated.pyx":4512
 *                 else:
 *                     v = &values[idx, 0]
 *                     o = &out[i, 0]             # <<<<<<<<<<<<<<
 *                     memmove(o, v, <size_t>(sizeof(float64_t) * k))
 *             return
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = 0;
        __pyx_v_o = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) ))));

        /* "pandas/src/generated.pyx":4513
 *                     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_L10:;
    }

    /* "pandas/src/generated.pyx":4514
 *                     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":4516
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4517
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/generated.pyx":4518
 *     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":4519
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_18 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_18; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4520
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) ) + __pyx_t_20 * __pyx_v_out.strides[1]) )) = __pyx_v_fv;
      }
      goto __pyx_L15;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4522
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_18 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_18; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4523
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_21 = __pyx_v_idx;
        __pyx_t_22 = __pyx_v_j;
        __pyx_t_23 = __pyx_v_i;
        __pyx_t_24 = __pyx_v_j;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_23 * __pyx_v_out.strides[0]) ) + __pyx_t_24 * __pyx_v_out.strides[1]) )) = (*__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));
      }
    }
    __pyx_L15:;
  }

  /* "pandas/src/generated.pyx":4473
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float64_float64(ndarray[float64_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4527
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_object_object_memview(object[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     object[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis0_object_object_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_object_object_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__199;
  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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_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;
  PyObject **__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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis0_object_object_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":4535
 *         object fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 4535; __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 = 4535; __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":4536
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values.shape[1]);

  /* "pandas/src/generated.pyx":4538
 *     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":4561
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4562
 * 
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_3 * __pyx_v_indexer.strides[0]) )));

    /* "pandas/src/generated.pyx":4563
 *     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":4564
 *         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":4565
 *         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_8 = ((PyObject * *) ( /* 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_GOTREF(*__pyx_t_8);
        __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_8);
        *__pyx_t_8 = __pyx_v_fv;
        __Pyx_GIVEREF(*__pyx_t_8);
      }
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4567
 *                 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":4568
 *         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_1 = (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_1);
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        __pyx_t_8 = ((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_8);
        __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_8);
        *__pyx_t_8 = __pyx_t_1;
        __Pyx_GIVEREF(*__pyx_t_8);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
    }
    __pyx_L5:;
  }

  /* "pandas/src/generated.pyx":4527
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis0_object_object_memview(object[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis0_object_object_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4574
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_object_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_299take_2d_axis0_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_299take_2d_axis0_object_object = {"take_2d_axis0_object_object", (PyCFunction)__pyx_pw_6pandas_5algos_299take_2d_axis0_object_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_299take_2d_axis0_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__200;
    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 = 4574; __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 = 4574; __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 = 4574; __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 = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4576; __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 = 4574; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4574; __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 = 4575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_298take_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_298take_2d_axis0_object_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis0_object_object_memview __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;
  PyObject **__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("take_2d_axis0_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_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 = 4574; __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_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 = 4574; __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":4578
 *                                     object[:, :] out,
 *                                     fill_value=np.nan):
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_object_object_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4578; __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[2]; __pyx_lineno = 4578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4580
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_object_object_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":4581
 *         # We can call the memoryview version of the code
 *         take_2d_axis0_object_object_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis0_object_object_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":4582
 *         take_2d_axis0_object_object_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":4591
 *         object fv
 * 
 *     n = len(indexer)             # <<<<<<<<<<<<<<
 *     k = values.shape[1]
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":4592
 * 
 *     n = len(indexer)
 *     k = values.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     fv = fill_value
 */
  __pyx_v_k = (__pyx_v_values->dimensions[1]);

  /* "pandas/src/generated.pyx":4594
 *     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":4617
 *             return
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx == -1:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4618
 * 
 *     for i from 0 <= i < n:
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx == -1:
 *             for j from 0 <= j < k:
 */
    __pyx_t_8 = __pyx_v_i;
    __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":4619
 *     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":4620
 *         idx = indexer[i]
 *         if idx == -1:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *         else:
 */
      __pyx_t_9 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_9; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4621
 *         if idx == -1:
 *             for j from 0 <= j < k:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < k:
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_j;
        __pyx_t_12 = ((PyObject * *) ( /* 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_GOTREF(*__pyx_t_12);
        __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_12);
        *__pyx_t_12 = __pyx_v_fv;
        __Pyx_GIVEREF(*__pyx_t_12);
      }
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":4623
 *                 out[i, j] = fv
 *         else:
 *             for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *                 out[i, j] = values[idx, j]
 * 
 */
      __pyx_t_9 = __pyx_v_k;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_9; __pyx_v_j++) {

        /* "pandas/src/generated.pyx":4624
 *         else:
 *             for j from 0 <= j < k:
 *                 out[i, j] = values[idx, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_13 = __pyx_v_idx;
        __pyx_t_14 = __pyx_v_j;
        __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_values.diminfo[1].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_2);
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        __pyx_t_12 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) ) + __pyx_t_16 * __pyx_v_out.strides[1]) ));
        __Pyx_GOTREF(*__pyx_t_12);
        __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_12);
        *__pyx_t_12 = __pyx_t_2;
        __Pyx_GIVEREF(*__pyx_t_12);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
    }
    __pyx_L6:;
  }

  /* "pandas/src/generated.pyx":4574
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_object_object(ndarray[object, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_fv);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4629
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_bool_bool_memview(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     uint8_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_bool_bool_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_bool_bool_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__201;
  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;
  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;
  __pyx_t_5numpy_uint8_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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_bool_bool_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":4637
 *         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 = 4637; __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 = 4637; __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":4638
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 4638; __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 = 4638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":4640
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4641
 * 
 *     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":4643
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __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 = 4643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4645
 *     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":4646
 * 
 *     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":4647
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_7 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":4648
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4649
 *             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_5numpy_uint8_t *) ( /* 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_v_fv;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4651
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":4629
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_bool_bool_memview(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_bool_bool_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4656
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_bool_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_301take_2d_axis1_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_301take_2d_axis1_bool_bool = {"take_2d_axis1_bool_bool", (PyCFunction)__pyx_pw_6pandas_5algos_301take_2d_axis1_bool_bool, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_301take_2d_axis1_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__202;
    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 = 4656; __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 = 4656; __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 = 4656; __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 = __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 = 4658; __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 = 4656; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4656; __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 = 4657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_300take_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_300take_2d_axis1_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_bool_bool_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_uint8_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_axis1_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_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 = 4656; __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_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 = 4656; __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":4661
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_bool_bool_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4661; __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[2]; __pyx_lineno = 4661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4663
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_bool_bool_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":4664
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_bool_bool_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_bool_bool_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":4665
 *         take_2d_axis1_bool_bool_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":4674
 *         uint8_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":4675
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":4677
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4678
 * 
 *     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":4680
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_9 = __Pyx_PyInt_As_npy_uint8(__pyx_v_fill_value); if (unlikely((__pyx_t_9 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_9;

  /* "pandas/src/generated.pyx":4682
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4683
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_10 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":4684
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_11 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":4685
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4686
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = __pyx_v_fv;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4688
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __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_BufPtrStrided2d(__pyx_t_5numpy_uint8_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));
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":4656
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_bool_bool(ndarray[uint8_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4691
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_bool_object_memview(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     object[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_bool_object_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_bool_object_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__203;
  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;
  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;
  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;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_bool_object_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":4699
 *         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 = 4699; __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 = 4699; __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":4700
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 4700; __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 = 4700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":4702
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4703
 * 
 *     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":4705
 *         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":4707
 *     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":4708
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_5 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":4709
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_6 = __pyx_v_j;
      __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_6 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":4710
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4711
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = True if values[i, idx] > 0 else False
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        __pyx_t_9 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_7 * __pyx_v_out.strides[0]) ) + __pyx_t_8 * __pyx_v_out.strides[1]) ));
        __Pyx_GOTREF(*__pyx_t_9);
        __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_9);
        *__pyx_t_9 = __pyx_v_fv;
        __Pyx_GIVEREF(*__pyx_t_9);
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4713
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = True if values[i, idx] > 0 else False             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        if ((((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __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_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        __pyx_t_9 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) ));
        __Pyx_GOTREF(*__pyx_t_9);
        __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_9);
        *__pyx_t_9 = __pyx_t_1;
        __Pyx_GIVEREF(*__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":4691
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_bool_object_memview(uint8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_bool_object_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4718
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_bool_object(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_303take_2d_axis1_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_303take_2d_axis1_bool_object = {"take_2d_axis1_bool_object", (PyCFunction)__pyx_pw_6pandas_5algos_303take_2d_axis1_bool_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_303take_2d_axis1_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__204;
    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 = 4718; __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 = 4718; __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 = 4718; __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 = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4720; __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 = 4718; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4718; __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 = 4719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_302take_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_302take_2d_axis1_bool_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_bool_object_memview __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;
  PyObject **__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_axis1_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_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 = 4718; __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_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 = 4718; __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":4723
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_bool_object_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4723; __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[2]; __pyx_lineno = 4723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4725
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_bool_object_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":4726
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_bool_object_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_bool_object_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":4727
 *         take_2d_axis1_bool_object_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":4736
 *         object fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":4737
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":4739
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4740
 * 
 *     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":4742
 *         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":4744
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4745
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_9 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_9; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":4746
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_10 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":4747
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4748
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = True if values[i, idx] > 0 else False
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        __pyx_t_13 = ((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_13);
        __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_13);
        *__pyx_t_13 = __pyx_v_fv;
        __Pyx_GIVEREF(*__pyx_t_13);
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4750
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = True if values[i, idx] > 0 else False             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        if ((((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_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)) > 0) != 0)) {
          __Pyx_INCREF(Py_True);
          __pyx_t_2 = Py_True;
        } else {
          __Pyx_INCREF(Py_False);
          __pyx_t_2 = Py_False;
        }
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_13 = ((PyObject * *) ( /* 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_GOTREF(*__pyx_t_13);
        __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_13);
        *__pyx_t_13 = __pyx_t_2;
        __Pyx_GIVEREF(*__pyx_t_13);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":4718
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_bool_object(ndarray[uint8_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_fv);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4753
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int8_int8_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int8_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int8_int8_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_int8_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__205;
  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;
  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;
  __pyx_t_5numpy_int8_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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_int8_int8_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":4761
 *         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 = 4761; __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 = 4761; __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":4762
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 4762; __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 = 4762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":4764
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4765
 * 
 *     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":4767
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __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 = 4767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4769
 *     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":4770
 * 
 *     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":4771
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_7 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":4772
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4773
 *             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_5numpy_int8_t *) ( /* 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_v_fv;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4775
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":4753
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int8_int8_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int8_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4780
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int8(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_305take_2d_axis1_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_305take_2d_axis1_int8_int8 = {"take_2d_axis1_int8_int8", (PyCFunction)__pyx_pw_6pandas_5algos_305take_2d_axis1_int8_int8, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_305take_2d_axis1_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__206;
    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 = 4780; __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 = 4780; __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 = 4780; __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 = __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 = 4782; __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 = 4780; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4780; __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 = 4781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_304take_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_304take_2d_axis1_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_int8_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_int8_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_axis1_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_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 = 4780; __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_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 = 4780; __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":4785
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int8_int8_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4785; __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[2]; __pyx_lineno = 4785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4787
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int8_int8_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":4788
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int8_int8_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_int8_int8_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":4789
 *         take_2d_axis1_int8_int8_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":4798
 *         int8_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":4799
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":4801
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4802
 * 
 *     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":4804
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_9 = __Pyx_PyInt_As_npy_int8(__pyx_v_fill_value); if (unlikely((__pyx_t_9 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_9;

  /* "pandas/src/generated.pyx":4806
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4807
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_10 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":4808
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_11 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":4809
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4810
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = __pyx_v_fv;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4812
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __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_BufPtrStrided2d(__pyx_t_5numpy_int8_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));
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":4780
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int8(ndarray[int8_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4815
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int8_int32_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int8_int32_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_int32_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__207;
  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;
  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;
  __pyx_t_5numpy_int32_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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_int8_int32_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":4823
 *         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 = 4823; __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 = 4823; __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":4824
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 4824; __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 = 4824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":4826
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4827
 * 
 *     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":4829
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __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 = 4829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4831
 *     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":4832
 * 
 *     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":4833
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_7 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":4834
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4835
 *             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_5numpy_int32_t *) ( /* 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_v_fv;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4837
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":4815
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int8_int32_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int32_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4842
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int32(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_307take_2d_axis1_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_307take_2d_axis1_int8_int32 = {"take_2d_axis1_int8_int32", (PyCFunction)__pyx_pw_6pandas_5algos_307take_2d_axis1_int8_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_307take_2d_axis1_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__208;
    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 = 4842; __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 = 4842; __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 = 4842; __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 = __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 = 4844; __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 = 4842; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4842; __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 = 4843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_306take_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_306take_2d_axis1_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_int32_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_int32_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_axis1_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_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 = 4842; __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_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 = 4842; __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":4847
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int8_int32_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4847; __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[2]; __pyx_lineno = 4847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4849
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int8_int32_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":4850
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int8_int32_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_int8_int32_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":4851
 *         take_2d_axis1_int8_int32_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":4860
 *         int32_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":4861
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":4863
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4864
 * 
 *     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":4866
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_9 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_9 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_9;

  /* "pandas/src/generated.pyx":4868
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4869
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_10 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":4870
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_11 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":4871
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4872
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = __pyx_v_fv;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4874
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __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_BufPtrStrided2d(__pyx_t_5numpy_int8_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));
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":4842
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int32(ndarray[int8_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4877
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int8_int64_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int8_int64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_int64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__209;
  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;
  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;
  __pyx_t_5numpy_int64_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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_int8_int64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":4885
 *         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 = 4885; __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 = 4885; __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":4886
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 4886; __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 = 4886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":4888
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4889
 * 
 *     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":4891
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __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 = 4891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4893
 *     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":4894
 * 
 *     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":4895
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_7 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":4896
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4897
 *             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_5numpy_int64_t *) ( /* 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_v_fv;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4899
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":4877
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int8_int64_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4904
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_309take_2d_axis1_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_309take_2d_axis1_int8_int64 = {"take_2d_axis1_int8_int64", (PyCFunction)__pyx_pw_6pandas_5algos_309take_2d_axis1_int8_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_309take_2d_axis1_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__210;
    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 = 4904; __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 = 4904; __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 = 4904; __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 = __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 = 4906; __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 = 4904; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4904; __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 = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_308take_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_308take_2d_axis1_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_int64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_int64_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_axis1_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_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 = 4904; __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_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 = 4904; __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":4909
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int8_int64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4909; __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[2]; __pyx_lineno = 4909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4911
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int8_int64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":4912
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int8_int64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_int8_int64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":4913
 *         take_2d_axis1_int8_int64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":4922
 *         int64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":4923
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":4925
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4926
 * 
 *     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":4928
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_9 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_9;

  /* "pandas/src/generated.pyx":4930
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4931
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_10 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":4932
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_11 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":4933
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4934
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = __pyx_v_fv;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4936
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __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_BufPtrStrided2d(__pyx_t_5numpy_int8_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));
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":4904
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int64(ndarray[int8_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4939
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int8_float64_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int8_float64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_float64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__211;
  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;
  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;
  __pyx_t_5numpy_float64_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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_int8_float64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":4947
 *         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 = 4947; __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 = 4947; __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":4948
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 4948; __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 = 4948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":4950
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4951
 * 
 *     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":4953
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __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 = 4953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":4955
 *     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":4956
 * 
 *     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":4957
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_7 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":4958
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4959
 *             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_5numpy_float64_t *) ( /* 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_v_fv;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4961
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":4939
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int8_float64_memview(int8_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_float64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":4966
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_float64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_311take_2d_axis1_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_311take_2d_axis1_int8_float64 = {"take_2d_axis1_int8_float64", (PyCFunction)__pyx_pw_6pandas_5algos_311take_2d_axis1_int8_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_311take_2d_axis1_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__212;
    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 = 4966; __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 = 4966; __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 = 4966; __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 = __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 = 4968; __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 = 4966; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __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 = 4967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_310take_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_310take_2d_axis1_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int8_float64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_float64_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_axis1_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_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 = 4966; __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_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 = 4966; __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":4971
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int8_float64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4971; __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[2]; __pyx_lineno = 4971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4973
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int8_float64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":4974
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int8_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_int8_float64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":4975
 *         take_2d_axis1_int8_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":4984
 *         float64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":4985
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":4987
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":4988
 * 
 *     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":4990
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_9 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_9;

  /* "pandas/src/generated.pyx":4992
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":4993
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_10 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":4994
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_11 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":4995
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":4996
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = __pyx_v_fv;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":4998
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __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_BufPtrStrided2d(__pyx_t_5numpy_int8_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));
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":4966
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_float64(ndarray[int8_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5001
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int16_int16_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int16_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int16_int16_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_int16_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__213;
  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;
  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;
  __pyx_t_5numpy_int16_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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_int16_int16_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":5009
 *         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 = 5009; __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 = 5009; __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":5010
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 5010; __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 = 5010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":5012
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5013
 * 
 *     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":5015
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __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 = 5015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5017
 *     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":5018
 * 
 *     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":5019
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_7 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":5020
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5021
 *             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_5numpy_int16_t *) ( /* 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_v_fv;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5023
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":5001
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int16_int16_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int16_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5028
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int16(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_313take_2d_axis1_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_313take_2d_axis1_int16_int16 = {"take_2d_axis1_int16_int16", (PyCFunction)__pyx_pw_6pandas_5algos_313take_2d_axis1_int16_int16, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_313take_2d_axis1_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__214;
    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 = 5028; __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 = 5028; __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 = 5028; __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 = __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 = 5030; __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 = 5028; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5028; __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 = 5029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_312take_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_312take_2d_axis1_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_int16_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_int16_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_axis1_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_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 = 5028; __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_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 = 5028; __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":5033
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int16_int16_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5033; __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[2]; __pyx_lineno = 5033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5035
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int16_int16_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":5036
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int16_int16_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_int16_int16_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":5037
 *         take_2d_axis1_int16_int16_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":5046
 *         int16_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":5047
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":5049
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5050
 * 
 *     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":5052
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_9 = __Pyx_PyInt_As_npy_int16(__pyx_v_fill_value); if (unlikely((__pyx_t_9 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_9;

  /* "pandas/src/generated.pyx":5054
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":5055
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_10 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":5056
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_11 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5057
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5058
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = __pyx_v_fv;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5060
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __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_BufPtrStrided2d(__pyx_t_5numpy_int16_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));
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":5028
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int16(ndarray[int16_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5063
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int16_int32_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int16_int32_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_int32_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__215;
  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;
  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;
  __pyx_t_5numpy_int32_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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_int16_int32_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":5071
 *         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 = 5071; __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 = 5071; __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":5072
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 5072; __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 = 5072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":5074
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5075
 * 
 *     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":5077
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __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 = 5077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5079
 *     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":5080
 * 
 *     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":5081
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_7 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":5082
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5083
 *             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_5numpy_int32_t *) ( /* 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_v_fv;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5085
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":5063
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int16_int32_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int32_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5090
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int32(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_315take_2d_axis1_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_315take_2d_axis1_int16_int32 = {"take_2d_axis1_int16_int32", (PyCFunction)__pyx_pw_6pandas_5algos_315take_2d_axis1_int16_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_315take_2d_axis1_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__216;
    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 = 5090; __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 = 5090; __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 = 5090; __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 = __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 = 5092; __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 = 5090; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5090; __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 = 5091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_314take_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_314take_2d_axis1_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_int32_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_int32_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_axis1_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_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 = 5090; __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_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 = 5090; __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":5095
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int16_int32_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5095; __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[2]; __pyx_lineno = 5095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5097
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int16_int32_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":5098
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int16_int32_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_int16_int32_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":5099
 *         take_2d_axis1_int16_int32_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":5108
 *         int32_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":5109
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":5111
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5112
 * 
 *     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":5114
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_9 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_9 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_9;

  /* "pandas/src/generated.pyx":5116
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":5117
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_10 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":5118
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_11 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5119
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5120
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = __pyx_v_fv;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5122
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __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_BufPtrStrided2d(__pyx_t_5numpy_int16_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));
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":5090
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int32(ndarray[int16_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5125
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int16_int64_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int16_int64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_int64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__217;
  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;
  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;
  __pyx_t_5numpy_int64_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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_int16_int64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":5133
 *         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 = 5133; __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 = 5133; __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":5134
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 5134; __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 = 5134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":5136
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5137
 * 
 *     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":5139
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __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 = 5139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5141
 *     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":5142
 * 
 *     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":5143
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_7 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":5144
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5145
 *             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_5numpy_int64_t *) ( /* 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_v_fv;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5147
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":5125
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int16_int64_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5152
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_317take_2d_axis1_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_317take_2d_axis1_int16_int64 = {"take_2d_axis1_int16_int64", (PyCFunction)__pyx_pw_6pandas_5algos_317take_2d_axis1_int16_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_317take_2d_axis1_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__218;
    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 = 5152; __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 = 5152; __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 = 5152; __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 = __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 = 5154; __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 = 5152; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5152; __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 = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_316take_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_316take_2d_axis1_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_int64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_int64_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_axis1_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_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 = 5152; __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_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 = 5152; __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":5157
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int16_int64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __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[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5159
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int16_int64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":5160
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int16_int64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_int16_int64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":5161
 *         take_2d_axis1_int16_int64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":5170
 *         int64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":5171
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":5173
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5174
 * 
 *     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":5176
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_9 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_9;

  /* "pandas/src/generated.pyx":5178
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":5179
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_10 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":5180
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_11 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5181
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5182
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = __pyx_v_fv;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5184
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __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_BufPtrStrided2d(__pyx_t_5numpy_int16_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));
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":5152
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int64(ndarray[int16_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5187
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int16_float64_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int16_float64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_float64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__219;
  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;
  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;
  __pyx_t_5numpy_float64_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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_int16_float64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":5195
 *         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 = 5195; __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 = 5195; __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":5196
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 5196; __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 = 5196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":5198
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5199
 * 
 *     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":5201
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __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 = 5201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5203
 *     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":5204
 * 
 *     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":5205
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_7 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":5206
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5207
 *             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_5numpy_float64_t *) ( /* 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_v_fv;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5209
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":5187
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int16_float64_memview(int16_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_float64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5214
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_float64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_319take_2d_axis1_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_319take_2d_axis1_int16_float64 = {"take_2d_axis1_int16_float64", (PyCFunction)__pyx_pw_6pandas_5algos_319take_2d_axis1_int16_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_319take_2d_axis1_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__220;
    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 = 5214; __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 = 5214; __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 = 5214; __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 = __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 = 5216; __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 = 5214; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5214; __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 = 5215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_318take_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_318take_2d_axis1_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int16_float64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_float64_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_axis1_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_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 = 5214; __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_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 = 5214; __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":5219
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int16_float64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5219; __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[2]; __pyx_lineno = 5219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5221
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int16_float64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":5222
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int16_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_int16_float64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":5223
 *         take_2d_axis1_int16_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":5232
 *         float64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":5233
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":5235
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5236
 * 
 *     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":5238
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_9 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_9;

  /* "pandas/src/generated.pyx":5240
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":5241
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_10 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":5242
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_11 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5243
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5244
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = __pyx_v_fv;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5246
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __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_BufPtrStrided2d(__pyx_t_5numpy_int16_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));
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":5214
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_float64(ndarray[int16_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5249
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int32_int32_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int32_int32_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int32_int32_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__221;
  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;
  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;
  __pyx_t_5numpy_int32_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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_int32_int32_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":5257
 *         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 = 5257; __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 = 5257; __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":5258
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 5258; __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 = 5258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":5260
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5261
 * 
 *     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":5263
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __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 = 5263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5265
 *     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":5266
 * 
 *     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":5267
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_7 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":5268
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5269
 *             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_5numpy_int32_t *) ( /* 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_v_fv;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5271
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":5249
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int32_int32_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_int32_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5276
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_321take_2d_axis1_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_321take_2d_axis1_int32_int32 = {"take_2d_axis1_int32_int32", (PyCFunction)__pyx_pw_6pandas_5algos_321take_2d_axis1_int32_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_321take_2d_axis1_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__222;
    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 = 5276; __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 = 5276; __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 = 5276; __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 = __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 = 5278; __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 = 5276; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5276; __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 = 5277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_320take_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_320take_2d_axis1_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int32_int32_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_int32_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_axis1_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_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 = 5276; __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_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 = 5276; __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":5281
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int32_int32_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5281; __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[2]; __pyx_lineno = 5281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5283
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int32_int32_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":5284
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int32_int32_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_int32_int32_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":5285
 *         take_2d_axis1_int32_int32_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":5294
 *         int32_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":5295
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":5297
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5298
 * 
 *     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":5300
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_9 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_9 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_9;

  /* "pandas/src/generated.pyx":5302
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":5303
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_10 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":5304
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_11 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5305
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5306
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = __pyx_v_fv;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5308
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __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_BufPtrStrided2d(__pyx_t_5numpy_int32_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));
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":5276
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_int32(ndarray[int32_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5311
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int32_int64_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int32_int64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int32_int64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__223;
  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;
  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;
  __pyx_t_5numpy_int64_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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_int32_int64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":5319
 *         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 = 5319; __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 = 5319; __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":5320
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 5320; __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 = 5320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":5322
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5323
 * 
 *     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":5325
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __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 = 5325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5327
 *     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":5328
 * 
 *     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":5329
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_7 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":5330
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5331
 *             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_5numpy_int64_t *) ( /* 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_v_fv;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5333
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":5311
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int32_int64_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_int64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5338
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_int64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_323take_2d_axis1_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_323take_2d_axis1_int32_int64 = {"take_2d_axis1_int32_int64", (PyCFunction)__pyx_pw_6pandas_5algos_323take_2d_axis1_int32_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_323take_2d_axis1_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__224;
    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 = 5338; __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 = 5338; __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 = 5338; __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 = __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 = 5340; __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 = 5338; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5338; __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 = 5339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_322take_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_322take_2d_axis1_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int32_int64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_int64_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_axis1_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_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 = 5338; __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_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 = 5338; __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":5343
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int32_int64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5343; __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[2]; __pyx_lineno = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5345
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int32_int64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":5346
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int32_int64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_int32_int64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":5347
 *         take_2d_axis1_int32_int64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":5356
 *         int64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":5357
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":5359
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5360
 * 
 *     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":5362
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_9 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_9;

  /* "pandas/src/generated.pyx":5364
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":5365
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_10 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":5366
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_11 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5367
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5368
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = __pyx_v_fv;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5370
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __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_BufPtrStrided2d(__pyx_t_5numpy_int32_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));
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":5338
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_int64(ndarray[int32_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5373
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int32_float64_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int32_float64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int32_float64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__225;
  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;
  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;
  __pyx_t_5numpy_float64_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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_int32_float64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":5381
 *         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 = 5381; __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 = 5381; __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":5382
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 5382; __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 = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":5384
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5385
 * 
 *     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":5387
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __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 = 5387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5389
 *     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":5390
 * 
 *     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":5391
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_7 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":5392
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5393
 *             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_5numpy_float64_t *) ( /* 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_v_fv;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5395
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":5373
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int32_float64_memview(int32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_float64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5400
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_float64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_325take_2d_axis1_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_325take_2d_axis1_int32_float64 = {"take_2d_axis1_int32_float64", (PyCFunction)__pyx_pw_6pandas_5algos_325take_2d_axis1_int32_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_325take_2d_axis1_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__226;
    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 = 5400; __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 = 5400; __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 = 5400; __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 = __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 = 5402; __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 = 5400; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5400; __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 = 5401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_324take_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_324take_2d_axis1_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int32_float64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_float64_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_axis1_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_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 = 5400; __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_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 = 5400; __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":5405
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int32_float64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5405; __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[2]; __pyx_lineno = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5407
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int32_float64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":5408
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int32_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_int32_float64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":5409
 *         take_2d_axis1_int32_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":5418
 *         float64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":5419
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":5421
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5422
 * 
 *     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":5424
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_9 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_9;

  /* "pandas/src/generated.pyx":5426
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":5427
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_10 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":5428
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_11 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5429
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5430
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = __pyx_v_fv;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5432
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __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_BufPtrStrided2d(__pyx_t_5numpy_int32_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));
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":5400
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_float64(ndarray[int32_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5435
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int64_int64_memview(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int64_int64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int64_int64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__227;
  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;
  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;
  __pyx_t_5numpy_int64_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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_int64_int64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":5443
 *         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 = 5443; __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 = 5443; __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":5444
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 5444; __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 = 5444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":5446
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5447
 * 
 *     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":5449
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __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 = 5449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5451
 *     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":5452
 * 
 *     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":5453
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_7 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":5454
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5455
 *             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_5numpy_int64_t *) ( /* 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_v_fv;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5457
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":5435
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int64_int64_memview(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int64_int64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5462
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int64_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_327take_2d_axis1_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_327take_2d_axis1_int64_int64 = {"take_2d_axis1_int64_int64", (PyCFunction)__pyx_pw_6pandas_5algos_327take_2d_axis1_int64_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_327take_2d_axis1_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__228;
    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 = 5462; __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 = 5462; __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 = 5462; __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 = __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 = 5464; __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 = 5462; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5462; __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 = 5463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_326take_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_326take_2d_axis1_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int64_int64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_int64_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_axis1_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_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 = 5462; __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_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 = 5462; __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":5467
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int64_int64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5467; __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[2]; __pyx_lineno = 5467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5469
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int64_int64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":5470
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int64_int64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_int64_int64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":5471
 *         take_2d_axis1_int64_int64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":5480
 *         int64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":5481
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":5483
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5484
 * 
 *     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":5486
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_9 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_9;

  /* "pandas/src/generated.pyx":5488
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":5489
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_10 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":5490
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_11 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5491
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5492
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = __pyx_v_fv;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5494
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __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_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));
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":5462
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int64_int64(ndarray[int64_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5497
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int64_float64_memview(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_int64_float64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int64_float64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__229;
  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;
  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;
  __pyx_t_5numpy_float64_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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_int64_float64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":5505
 *         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 = 5505; __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 = 5505; __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":5506
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 5506; __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 = 5506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":5508
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5509
 * 
 *     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":5511
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __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 = 5511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5513
 *     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":5514
 * 
 *     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":5515
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_7 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":5516
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5517
 *             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_5numpy_float64_t *) ( /* 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_v_fv;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5519
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":5497
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_int64_float64_memview(int64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int64_float64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5524
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int64_float64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_329take_2d_axis1_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_329take_2d_axis1_int64_float64 = {"take_2d_axis1_int64_float64", (PyCFunction)__pyx_pw_6pandas_5algos_329take_2d_axis1_int64_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_329take_2d_axis1_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__230;
    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 = 5524; __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 = 5524; __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 = 5524; __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 = __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 = 5526; __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 = 5524; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5524; __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 = 5525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_328take_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_328take_2d_axis1_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_int64_float64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_float64_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_axis1_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_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 = 5524; __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_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 = 5524; __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":5529
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int64_float64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5529; __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[2]; __pyx_lineno = 5529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5531
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int64_float64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":5532
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_int64_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_int64_float64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":5533
 *         take_2d_axis1_int64_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":5542
 *         float64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":5543
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":5545
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5546
 * 
 *     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":5548
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_9 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_9;

  /* "pandas/src/generated.pyx":5550
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":5551
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_10 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":5552
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_11 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5553
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5554
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = __pyx_v_fv;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5556
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __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_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));
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":5524
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int64_float64(ndarray[int64_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5559
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_float32_float32_memview(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float32_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_float32_float32_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_float32_float32_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__231;
  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;
  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;
  __pyx_t_5numpy_float32_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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_float32_float32_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":5567
 *         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 = 5567; __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 = 5567; __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":5568
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 5568; __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 = 5568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":5570
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5571
 * 
 *     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":5573
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __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 = 5573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5575
 *     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":5576
 * 
 *     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":5577
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_7 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":5578
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5579
 *             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_5numpy_float32_t *) ( /* 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_v_fv;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5581
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = (*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":5559
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_float32_float32_memview(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float32_float32_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5586
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float32_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_331take_2d_axis1_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_331take_2d_axis1_float32_float32 = {"take_2d_axis1_float32_float32", (PyCFunction)__pyx_pw_6pandas_5algos_331take_2d_axis1_float32_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_331take_2d_axis1_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__232;
    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 = 5586; __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 = 5586; __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 = 5586; __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 = __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 = 5588; __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 = 5586; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5586; __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 = 5587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_330take_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_330take_2d_axis1_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_float32_float32_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_float32_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_axis1_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_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 = 5586; __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_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 = 5586; __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":5591
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_float32_float32_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5591; __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[2]; __pyx_lineno = 5591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5593
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_float32_float32_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":5594
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_float32_float32_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_float32_float32_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":5595
 *         take_2d_axis1_float32_float32_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":5604
 *         float32_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":5605
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":5607
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5608
 * 
 *     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":5610
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_v_fill_value); if (unlikely((__pyx_t_9 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_9;

  /* "pandas/src/generated.pyx":5612
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":5613
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_10 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":5614
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_11 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5615
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5616
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = __pyx_v_fv;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5618
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __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_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));
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":5586
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float32_float32(ndarray[float32_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5621
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_float32_float64_memview(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_float32_float64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_float32_float64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__233;
  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;
  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;
  __pyx_t_5numpy_float64_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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_float32_float64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":5629
 *         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 = 5629; __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 = 5629; __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":5630
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 5630; __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 = 5630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":5632
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5633
 * 
 *     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":5635
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __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 = 5635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5637
 *     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":5638
 * 
 *     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":5639
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_7 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":5640
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5641
 *             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_5numpy_float64_t *) ( /* 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_v_fv;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5643
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = (*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":5621
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_float32_float64_memview(float32_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float32_float64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5648
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float32_float64(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_333take_2d_axis1_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_333take_2d_axis1_float32_float64 = {"take_2d_axis1_float32_float64", (PyCFunction)__pyx_pw_6pandas_5algos_333take_2d_axis1_float32_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_333take_2d_axis1_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__234;
    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 = 5648; __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 = 5648; __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 = 5648; __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 = __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 = 5650; __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 = 5648; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5648; __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 = 5649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_332take_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_332take_2d_axis1_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_float32_float64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_float64_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_axis1_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_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 = 5648; __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_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 = 5648; __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":5653
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_float32_float64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5653; __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[2]; __pyx_lineno = 5653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5655
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_float32_float64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":5656
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_float32_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_float32_float64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":5657
 *         take_2d_axis1_float32_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":5666
 *         float64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":5667
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":5669
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5670
 * 
 *     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":5672
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_9 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_9;

  /* "pandas/src/generated.pyx":5674
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":5675
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_10 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":5676
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_11 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5677
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5678
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = __pyx_v_fv;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5680
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __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_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));
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":5648
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float32_float64(ndarray[float32_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5683
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_float64_float64_memview(float64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_float64_float64_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_float64_float64_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__235;
  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;
  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;
  __pyx_t_5numpy_float64_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;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_float64_float64_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":5691
 *         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 = 5691; __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 = 5691; __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":5692
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 5692; __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 = 5692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":5694
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5695
 * 
 *     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":5697
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __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 = 5697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5699
 *     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":5700
 * 
 *     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":5701
 *     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_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_7 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":5702
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5703
 *             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_5numpy_float64_t *) ( /* 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_v_fv;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5705
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":5683
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_float64_float64_memview(float64_t[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float64_float64_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5710
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float64_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_335take_2d_axis1_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_335take_2d_axis1_float64_float64 = {"take_2d_axis1_float64_float64", (PyCFunction)__pyx_pw_6pandas_5algos_335take_2d_axis1_float64_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_335take_2d_axis1_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__236;
    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 = 5710; __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 = 5710; __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 = 5710; __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 = __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 = 5712; __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 = 5710; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5710; __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 = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_334take_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_334take_2d_axis1_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_float64_float64_memview __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_5numpy_float64_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_axis1_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_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 = 5710; __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_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 = 5710; __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":5715
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_float64_float64_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5715; __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[2]; __pyx_lineno = 5715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5717
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_float64_float64_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":5718
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_float64_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_float64_float64_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":5719
 *         take_2d_axis1_float64_float64_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":5728
 *         float64_t fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":5729
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":5731
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5732
 * 
 *     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":5734
 *         return
 * 
 *     fv = fill_value             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_9 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_9;

  /* "pandas/src/generated.pyx":5736
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":5737
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_10 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":5738
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_11 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5739
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5740
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        *((__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]) )) = __pyx_v_fv;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5742
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __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_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));
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":5710
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float64_float64(ndarray[float64_t, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5745
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_object_object_memview(object[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     int64_t[:] indexer,
 *                                                     object[:, :] out,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_take_2d_axis1_object_object_memview(__Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_object_object_memview *__pyx_optional_args) {
  PyObject *__pyx_v_fill_value = __pyx_k__237;
  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;
  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;
  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;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_2d_axis1_object_object_memview", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fill_value = __pyx_optional_args->fill_value;
    }
  }

  /* "pandas/src/generated.pyx":5753
 *         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 = 5753; __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 = 5753; __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":5754
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_indexer, 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[2]; __pyx_lineno = 5754; __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 = 5754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_k = __pyx_t_2;

  /* "pandas/src/generated.pyx":5756
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5757
 * 
 *     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":5759
 *         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":5761
 *     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":5762
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_5 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":5763
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_6 = __pyx_v_j;
      __pyx_v_idx = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_indexer.data + __pyx_t_6 * __pyx_v_indexer.strides[0]) )));

      /* "pandas/src/generated.pyx":5764
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5765
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_8 = __pyx_v_j;
        __pyx_t_9 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_7 * __pyx_v_out.strides[0]) ) + __pyx_t_8 * __pyx_v_out.strides[1]) ));
        __Pyx_GOTREF(*__pyx_t_9);
        __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_9);
        *__pyx_t_9 = __pyx_v_fv;
        __Pyx_GIVEREF(*__pyx_t_9);
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5767
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_idx;
        __pyx_t_1 = (PyObject *) *((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_10 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) ));
        __Pyx_INCREF((PyObject*)__pyx_t_1);
        __pyx_t_12 = __pyx_v_i;
        __pyx_t_13 = __pyx_v_j;
        __pyx_t_9 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) ));
        __Pyx_GOTREF(*__pyx_t_9);
        __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_9);
        *__pyx_t_9 = __pyx_t_1;
        __Pyx_GIVEREF(*__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/generated.pyx":5745
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * cdef inline take_2d_axis1_object_object_memview(object[:, :] values,             # <<<<<<<<<<<<<<
 *                                                     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);
  __Pyx_AddTraceback("pandas.algos.take_2d_axis1_object_object_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5772
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_object_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_337take_2d_axis1_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_337take_2d_axis1_object_object = {"take_2d_axis1_object_object", (PyCFunction)__pyx_pw_6pandas_5algos_337take_2d_axis1_object_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_337take_2d_axis1_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 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__238;
    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 = 5772; __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 = 5772; __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 = 5772; __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 = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5774; __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 = 5772; __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_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5772; __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 = 5773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_336take_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_336take_2d_axis1_object_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__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;
  __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;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_opt_args_6pandas_5algos_take_2d_axis1_object_object_memview __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;
  PyObject **__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_axis1_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_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 = 5772; __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_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 = 5772; __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":5777
 *                                     fill_value=np.nan):
 * 
 *     if values.flags.writeable:             # <<<<<<<<<<<<<<
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_object_object_memview(values, indexer, out,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_writeable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5777; __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[2]; __pyx_lineno = 5777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5779
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_object_object_memview(values, indexer, out,             # <<<<<<<<<<<<<<
 *                                                 fill_value=fill_value)
 *         return
 */
    __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(((PyObject *)__pyx_v_values));
    if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_indexer));
    if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/generated.pyx":5780
 *         # We can call the memoryview version of the code
 *         take_2d_axis1_object_object_memview(values, indexer, out,
 *                                                 fill_value=fill_value)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.fill_value = __pyx_v_fill_value;
    __pyx_t_2 = __pyx_f_6pandas_5algos_take_2d_axis1_object_object_memview(__pyx_t_4, __pyx_t_5, __pyx_v_out, &__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/generated.pyx":5781
 *         take_2d_axis1_object_object_memview(values, indexer, out,
 *                                                 fill_value=fill_value)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # We cannot use the memoryview version on readonly-buffers due to
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pandas/src/generated.pyx":5790
 *         object fv
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     k = len(indexer)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "pandas/src/generated.pyx":5791
 * 
 *     n = len(values)
 *     k = len(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0 or k == 0:
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_7;

  /* "pandas/src/generated.pyx":5793
 *     k = len(indexer)
 * 
 *     if n == 0 or k == 0:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_8 = ((__pyx_v_n == 0) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_v_k == 0) != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "pandas/src/generated.pyx":5794
 * 
 *     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":5796
 *         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":5798
 *     fv = fill_value
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/generated.pyx":5799
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             idx = indexer[j]
 *             if idx == -1:
 */
    __pyx_t_9 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_9; __pyx_v_j++) {

      /* "pandas/src/generated.pyx":5800
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             idx = indexer[j]             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 out[i, j] = fv
 */
      __pyx_t_10 = __pyx_v_j;
      __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_indexer.diminfo[0].strides));

      /* "pandas/src/generated.pyx":5801
 *         for j from 0 <= j < k:
 *             idx = indexer[j]
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 out[i, j] = fv
 *             else:
 */
      __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":5802
 *             idx = indexer[j]
 *             if idx == -1:
 *                 out[i, j] = fv             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = values[i, idx]
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_12 = __pyx_v_j;
        __pyx_t_13 = ((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_13);
        __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_13);
        *__pyx_t_13 = __pyx_v_fv;
        __Pyx_GIVEREF(*__pyx_t_13);
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":5804
 *                 out[i, j] = fv
 *             else:
 *                 out[i, j] = values[i, idx]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_15 = __pyx_v_idx;
        __pyx_t_2 = (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_2);
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_13 = ((PyObject * *) ( /* 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_GOTREF(*__pyx_t_13);
        __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_13);
        *__pyx_t_13 = __pyx_t_2;
        __Pyx_GIVEREF(*__pyx_t_13);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/generated.pyx":5772
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_object_object(ndarray[object, ndim=2] 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);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
  { 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_values.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_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_fv);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/generated.pyx":5808
 * @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_339take_2d_multi_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_339take_2d_multi_bool_bool = {"take_2d_multi_bool_bool", (PyCFunction)__pyx_pw_6pandas_5algos_339take_2d_multi_bool_bool, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_339take_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__239;
    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 = 5808; __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 = 5808; __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 = 5808; __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 = 5808; __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 = 5808; __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 = 5810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_338take_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_338take_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 = 5808; __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 = 5808; __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":5814
 *     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 = 5814; __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 = 5814; __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 = 5814; __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":5815
 *         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 = 5815; __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 = 5815; __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 = 5815; __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":5818
 *         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 = 5818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":5819
 * 
 *     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 = 5819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":5821
 *     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 = 5821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5822
 * 
 *     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":5823
 *     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":5824
 *     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":5825
 *         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":5826
 *         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":5828
 *                 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":5829
 *         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":5830
 *             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":5832
 *                     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":5808
 * @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":5836
 * @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_341take_2d_multi_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_341take_2d_multi_bool_object = {"take_2d_multi_bool_object", (PyCFunction)__pyx_pw_6pandas_5algos_341take_2d_multi_bool_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_341take_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__240;
    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 = 5836; __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 = 5836; __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 = 5836; __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 = 5836; __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 = 5836; __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 = 5838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_340take_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_340take_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 = 5836; __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 = 5836; __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":5842
 *     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 = 5842; __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 = 5842; __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 = 5842; __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":5843
 *         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 = 5843; __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 = 5843; __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 = 5843; __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":5846
 *         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 = 5846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":5847
 * 
 *     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 = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":5849
 *     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":5850
 * 
 *     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":5851
 *     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":5852
 *     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":5853
 *         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":5854
 *         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":5856
 *                 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":5857
 *         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":5858
 *             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":5860
 *                     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":5836
 * @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":5864
 * @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_343take_2d_multi_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_343take_2d_multi_int8_int8 = {"take_2d_multi_int8_int8", (PyCFunction)__pyx_pw_6pandas_5algos_343take_2d_multi_int8_int8, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_343take_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__241;
    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 = 5864; __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 = 5864; __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 = 5864; __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 = 5864; __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 = 5864; __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 = 5866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_342take_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_342take_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 = 5864; __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 = 5864; __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":5870
 *     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 = 5870; __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 = 5870; __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 = 5870; __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":5871
 *         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 = 5871; __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 = 5871; __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 = 5871; __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":5874
 *         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 = 5874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":5875
 * 
 *     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 = 5875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":5877
 *     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 = 5877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5878
 * 
 *     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":5879
 *     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":5880
 *     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":5881
 *         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":5882
 *         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":5884
 *                 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":5885
 *         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":5886
 *             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":5888
 *                     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":5864
 * @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":5892
 * @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_345take_2d_multi_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_345take_2d_multi_int8_int32 = {"take_2d_multi_int8_int32", (PyCFunction)__pyx_pw_6pandas_5algos_345take_2d_multi_int8_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_345take_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__242;
    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 = 5892; __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 = 5892; __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 = 5892; __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 = 5892; __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 = 5892; __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 = 5894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_344take_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_344take_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 = 5892; __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 = 5892; __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":5898
 *     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 = 5898; __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 = 5898; __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 = 5898; __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":5899
 *         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 = 5899; __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 = 5899; __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 = 5899; __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":5902
 *         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 = 5902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":5903
 * 
 *     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 = 5903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":5905
 *     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 = 5905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5906
 * 
 *     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":5907
 *     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":5908
 *     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":5909
 *         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":5910
 *         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":5912
 *                 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":5913
 *         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":5914
 *             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":5916
 *                     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":5892
 * @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":5920
 * @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_347take_2d_multi_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_347take_2d_multi_int8_int64 = {"take_2d_multi_int8_int64", (PyCFunction)__pyx_pw_6pandas_5algos_347take_2d_multi_int8_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_347take_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__243;
    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 = 5920; __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 = 5920; __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 = 5920; __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 = 5920; __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 = 5920; __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 = 5922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_346take_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_346take_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 = 5920; __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 = 5920; __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":5926
 *     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 = 5926; __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 = 5926; __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 = 5926; __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":5927
 *         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 = 5927; __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 = 5927; __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 = 5927; __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":5930
 *         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 = 5930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":5931
 * 
 *     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 = 5931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":5933
 *     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 = 5933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5934
 * 
 *     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":5935
 *     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":5936
 *     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":5937
 *         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":5938
 *         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":5940
 *                 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":5941
 *         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":5942
 *             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":5944
 *                     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":5920
 * @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":5948
 * @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_349take_2d_multi_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_349take_2d_multi_int8_float64 = {"take_2d_multi_int8_float64", (PyCFunction)__pyx_pw_6pandas_5algos_349take_2d_multi_int8_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_349take_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__244;
    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 = 5948; __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 = 5948; __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 = 5948; __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 = 5948; __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 = 5948; __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 = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_348take_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_348take_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 = 5948; __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 = 5948; __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":5954
 *     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 = 5954; __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 = 5954; __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 = 5954; __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":5955
 *         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 = 5955; __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 = 5955; __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 = 5955; __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":5958
 *         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 = 5958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":5959
 * 
 *     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 = 5959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":5961
 *     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 = 5961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5962
 * 
 *     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":5963
 *     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":5964
 *     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":5965
 *         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":5966
 *         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":5968
 *                 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":5969
 *         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":5970
 *             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":5972
 *                     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":5948
 * @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":5976
 * @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_351take_2d_multi_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_351take_2d_multi_int16_int16 = {"take_2d_multi_int16_int16", (PyCFunction)__pyx_pw_6pandas_5algos_351take_2d_multi_int16_int16, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_351take_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__245;
    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 = 5976; __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 = 5976; __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 = 5976; __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 = 5976; __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 = 5976; __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 = 5978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_350take_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_350take_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 = 5976; __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 = 5976; __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":5982
 *     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 = 5982; __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 = 5982; __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 = 5982; __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":5983
 *         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 = 5983; __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 = 5983; __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 = 5983; __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":5986
 *         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 = 5986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":5987
 * 
 *     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 = 5987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":5989
 *     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 = 5989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":5990
 * 
 *     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":5991
 *     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":5992
 *     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":5993
 *         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":5994
 *         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":5996
 *                 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":5997
 *         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":5998
 *             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":6000
 *                     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":5976
 * @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":6004
 * @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_353take_2d_multi_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_353take_2d_multi_int16_int32 = {"take_2d_multi_int16_int32", (PyCFunction)__pyx_pw_6pandas_5algos_353take_2d_multi_int16_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_353take_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__246;
    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 = 6004; __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 = 6004; __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 = 6004; __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 = 6004; __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 = 6004; __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 = 6006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_352take_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_352take_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 = 6004; __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 = 6004; __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":6010
 *     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 = 6010; __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 = 6010; __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 = 6010; __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":6011
 *         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 = 6011; __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 = 6011; __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 = 6011; __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":6014
 *         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 = 6014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":6015
 * 
 *     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 = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":6017
 *     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 = 6017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":6018
 * 
 *     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":6019
 *     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":6020
 *     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":6021
 *         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":6022
 *         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":6024
 *                 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":6025
 *         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":6026
 *             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":6028
 *                     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":6004
 * @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":6032
 * @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_355take_2d_multi_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_355take_2d_multi_int16_int64 = {"take_2d_multi_int16_int64", (PyCFunction)__pyx_pw_6pandas_5algos_355take_2d_multi_int16_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_355take_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__247;
    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 = 6032; __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 = 6032; __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 = 6032; __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 = 6032; __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 = 6032; __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 = 6034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_354take_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_354take_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 = 6032; __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 = 6032; __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":6038
 *     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 = 6038; __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 = 6038; __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 = 6038; __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":6039
 *         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 = 6039; __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 = 6039; __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 = 6039; __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":6042
 *         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 = 6042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":6043
 * 
 *     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 = 6043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":6045
 *     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 = 6045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":6046
 * 
 *     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":6047
 *     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":6048
 *     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":6049
 *         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":6050
 *         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":6052
 *                 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":6053
 *         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":6054
 *             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":6056
 *                     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":6032
 * @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":6060
 * @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_357take_2d_multi_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_357take_2d_multi_int16_float64 = {"take_2d_multi_int16_float64", (PyCFunction)__pyx_pw_6pandas_5algos_357take_2d_multi_int16_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_357take_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__248;
    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 = 6060; __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 = 6060; __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 = 6060; __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 = 6060; __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 = 6060; __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 = 6062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_356take_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_356take_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 = 6060; __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 = 6060; __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":6066
 *     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 = 6066; __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 = 6066; __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 = 6066; __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":6067
 *         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 = 6067; __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 = 6067; __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 = 6067; __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":6070
 *         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 = 6070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":6071
 * 
 *     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 = 6071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":6073
 *     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 = 6073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":6074
 * 
 *     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":6075
 *     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":6076
 *     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":6077
 *         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":6078
 *         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":6080
 *                 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":6081
 *         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":6082
 *             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":6084
 *                     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":6060
 * @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":6088
 * @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_359take_2d_multi_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_359take_2d_multi_int32_int32 = {"take_2d_multi_int32_int32", (PyCFunction)__pyx_pw_6pandas_5algos_359take_2d_multi_int32_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_359take_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__249;
    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 = 6088; __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 = 6088; __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 = 6088; __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 = 6088; __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 = 6088; __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 = 6090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_358take_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_358take_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 = 6088; __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 = 6088; __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":6094
 *     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 = 6094; __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 = 6094; __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 = 6094; __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":6095
 *         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 = 6095; __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 = 6095; __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 = 6095; __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":6098
 *         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 = 6098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":6099
 * 
 *     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 = 6099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":6101
 *     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 = 6101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":6102
 * 
 *     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":6103
 *     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":6104
 *     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":6105
 *         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":6106
 *         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":6108
 *                 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":6109
 *         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":6110
 *             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":6112
 *                     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":6088
 * @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":6116
 * @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_361take_2d_multi_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_361take_2d_multi_int32_int64 = {"take_2d_multi_int32_int64", (PyCFunction)__pyx_pw_6pandas_5algos_361take_2d_multi_int32_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_361take_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__250;
    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 = 6116; __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 = 6116; __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 = 6116; __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 = 6116; __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 = 6116; __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 = 6118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_360take_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_360take_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 = 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_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 = 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];

  /* "pandas/src/generated.pyx":6122
 *     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 = 6122; __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 = 6122; __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 = 6122; __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":6123
 *         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 = 6123; __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 = 6123; __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 = 6123; __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":6126
 *         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 = 6126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":6127
 * 
 *     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 = 6127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":6129
 *     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 = 6129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":6130
 * 
 *     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":6131
 *     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":6132
 *     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":6133
 *         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":6134
 *         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":6136
 *                 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":6137
 *         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":6138
 *             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":6140
 *                     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":6116
 * @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":6144
 * @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_363take_2d_multi_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_363take_2d_multi_int32_float64 = {"take_2d_multi_int32_float64", (PyCFunction)__pyx_pw_6pandas_5algos_363take_2d_multi_int32_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_363take_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__251;
    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 = 6144; __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 = 6144; __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 = 6144; __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 = 6144; __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 = 6144; __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 = 6146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_362take_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_362take_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 = 6144; __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 = 6144; __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":6150
 *     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 = 6150; __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 = 6150; __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 = 6150; __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":6151
 *         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 = 6151; __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 = 6151; __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 = 6151; __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":6154
 *         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 = 6154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":6155
 * 
 *     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 = 6155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":6157
 *     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 = 6157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":6158
 * 
 *     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":6159
 *     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":6160
 *     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":6161
 *         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":6162
 *         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":6164
 *                 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":6165
 *         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":6166
 *             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":6168
 *                     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":6144
 * @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":6172
 * @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_365take_2d_multi_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_365take_2d_multi_int64_int64 = {"take_2d_multi_int64_int64", (PyCFunction)__pyx_pw_6pandas_5algos_365take_2d_multi_int64_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_365take_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__252;
    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 = 6172; __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 = 6172; __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 = 6172; __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 = 6172; __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 = 6172; __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 = 6174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_364take_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_364take_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 = 6172; __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 = 6172; __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":6178
 *     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 = 6178; __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 = 6178; __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 = 6178; __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":6179
 *         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 = 6179; __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 = 6179; __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 = 6179; __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":6182
 *         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 = 6182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":6183
 * 
 *     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 = 6183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":6185
 *     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 = 6185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":6186
 * 
 *     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":6187
 *     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":6188
 *     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":6189
 *         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":6190
 *         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":6192
 *                 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":6193
 *         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":6194
 *             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":6196
 *                     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":6172
 * @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":6200
 * @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_367take_2d_multi_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_367take_2d_multi_int64_float64 = {"take_2d_multi_int64_float64", (PyCFunction)__pyx_pw_6pandas_5algos_367take_2d_multi_int64_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_367take_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__253;
    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 = 6200; __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 = 6200; __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 = 6200; __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 = 6200; __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 = 6200; __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 = 6202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_366take_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_366take_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 = 6200; __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 = 6200; __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":6206
 *     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 = 6206; __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 = 6206; __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 = 6206; __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":6207
 *         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 = 6207; __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 = 6207; __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 = 6207; __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":6210
 *         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 = 6210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":6211
 * 
 *     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 = 6211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":6213
 *     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 = 6213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":6214
 * 
 *     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":6215
 *     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":6216
 *     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":6217
 *         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":6218
 *         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":6220
 *                 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":6221
 *         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":6222
 *             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":6224
 *                     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":6200
 * @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":6228
 * @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_369take_2d_multi_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_369take_2d_multi_float32_float32 = {"take_2d_multi_float32_float32", (PyCFunction)__pyx_pw_6pandas_5algos_369take_2d_multi_float32_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_369take_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__254;
    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 = 6228; __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 = 6228; __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 = 6228; __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 = 6228; __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 = 6228; __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 = 6230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_368take_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_368take_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 = 6228; __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 = 6228; __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":6234
 *     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 = 6234; __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 = 6234; __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 = 6234; __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":6235
 *         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 = 6235; __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 = 6235; __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 = 6235; __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":6238
 *         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 = 6238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":6239
 * 
 *     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 = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":6241
 *     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 = 6241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":6242
 * 
 *     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":6243
 *     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":6244
 *     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":6245
 *         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":6246
 *         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":6248
 *                 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":6249
 *         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":6250
 *             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":6252
 *                     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":6228
 * @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":6256
 * @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_371take_2d_multi_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_371take_2d_multi_float32_float64 = {"take_2d_multi_float32_float64", (PyCFunction)__pyx_pw_6pandas_5algos_371take_2d_multi_float32_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_371take_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__255;
    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 = 6256; __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 = 6256; __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 = 6256; __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 = 6256; __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 = 6256; __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 = 6258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_370take_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_370take_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 = 6256; __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 = 6256; __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":6262
 *     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 = 6262; __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 = 6262; __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 = 6262; __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":6263
 *         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 = 6263; __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 = 6263; __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 = 6263; __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":6266
 *         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 = 6266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":6267
 * 
 *     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 = 6267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":6269
 *     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 = 6269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":6270
 * 
 *     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":6271
 *     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":6272
 *     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":6273
 *         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":6274
 *         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":6276
 *                 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":6277
 *         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":6278
 *             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":6280
 *                     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":6256
 * @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":6284
 * @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_373take_2d_multi_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_373take_2d_multi_float64_float64 = {"take_2d_multi_float64_float64", (PyCFunction)__pyx_pw_6pandas_5algos_373take_2d_multi_float64_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_373take_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__256;
    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 = 6284; __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 = 6284; __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 = 6284; __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 = 6284; __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 = 6284; __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 = 6286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_372take_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_372take_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 = 6284; __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 = 6284; __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":6290
 *     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 = 6290; __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 = 6290; __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 = 6290; __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":6291
 *         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 = 6291; __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 = 6291; __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 = 6291; __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":6294
 *         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 = 6294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":6295
 * 
 *     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 = 6295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":6297
 *     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 = 6297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fv = __pyx_t_5;

  /* "pandas/src/generated.pyx":6298
 * 
 *     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":6299
 *     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":6300
 *     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":6301
 *         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":6302
 *         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":6304
 *                 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":6305
 *         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":6306
 *             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":6308
 *                     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":6284
 * @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":6312
 * @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_375take_2d_multi_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_375take_2d_multi_object_object = {"take_2d_multi_object_object", (PyCFunction)__pyx_pw_6pandas_5algos_375take_2d_multi_object_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_375take_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__257;
    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 = 6312; __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 = 6312; __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 = 6312; __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 = 6312; __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 = 6312; __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 = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_374take_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_374take_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 = 6312; __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 = 6312; __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":6318
 *     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 = 6318; __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 = 6318; __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 = 6318; __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":6319
 *         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 = 6319; __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 = 6319; __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 = 6319; __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":6322
 *         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 = 6322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "pandas/src/generated.pyx":6323
 * 
 *     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 = 6323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_4;

  /* "pandas/src/generated.pyx":6325
 *     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":6326
 * 
 *     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":6327
 *     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":6328
 *     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":6329
 *         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":6330
 *         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":6332
 *                 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":6333
 *         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":6334
 *             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":6336
 *                     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":6312
 * @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":6341
 * @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_377diff_2d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_377diff_2d_float64 = {"diff_2d_float64", (PyCFunction)__pyx_pw_6pandas_5algos_377diff_2d_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_377diff_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 = 6341; __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 = 6341; __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 = 6341; __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 = 6341; __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 = 6343; __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 = 6343; __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 = 6341; __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 = 6341; __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 = 6342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_376diff_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_376diff_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 = 6341; __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 = 6341; __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":6347
 *         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 = 6347; __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 = 6347; __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 = 6347; __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 = 6347; __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 = 6347; __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 = 6347; __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 = 6347; __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 = 6347; __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 = 6347; __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":6348
 * 
 *     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 = 6348; __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 = 6348; __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 = 6348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":6349
 *     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":6350
 *     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":6351
 *         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":6353
 *                 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":6354
 *             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":6355
 *                 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":6356
 *             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":6358
 *                     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":6359
 *         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":6361
 *                 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":6362
 *             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":6363
 *                 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":6364
 *             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":6366
 *                     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":6367
 *     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":6368
 *         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":6370
 *                 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":6371
 *             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":6372
 *                 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":6373
 *             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":6375
 *                     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":6376
 *         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":6378
 *                 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":6379
 *             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":6380
 *                 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":6381
 *             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":6341
 * @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":6384
 * @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_379diff_2d_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_379diff_2d_float32 = {"diff_2d_float32", (PyCFunction)__pyx_pw_6pandas_5algos_379diff_2d_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_379diff_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 = 6384; __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 = 6384; __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 = 6384; __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 = 6384; __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 = 6386; __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 = 6386; __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 = 6384; __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 = 6384; __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 = 6385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_378diff_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_378diff_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 = 6384; __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 = 6384; __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":6390
 *         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 = 6390; __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 = 6390; __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 = 6390; __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 = 6390; __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 = 6390; __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 = 6390; __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 = 6390; __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 = 6390; __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 = 6390; __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":6391
 * 
 *     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 = 6391; __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 = 6391; __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 = 6391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":6392
 *     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":6393
 *     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":6394
 *         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":6396
 *                 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":6397
 *             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":6398
 *                 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":6399
 *             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":6401
 *                     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":6402
 *         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":6404
 *                 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":6405
 *             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":6406
 *                 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":6407
 *             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":6409
 *                     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":6410
 *     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":6411
 *         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":6413
 *                 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":6414
 *             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":6415
 *                 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":6416
 *             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":6418
 *                     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":6419
 *         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":6421
 *                 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":6422
 *             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":6423
 *                 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":6424
 *             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":6384
 * @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":6427
 * @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_381diff_2d_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_381diff_2d_int8 = {"diff_2d_int8", (PyCFunction)__pyx_pw_6pandas_5algos_381diff_2d_int8, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_381diff_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 = 6427; __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 = 6427; __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 = 6427; __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 = 6427; __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 = 6429; __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 = 6429; __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 = 6427; __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 = 6427; __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 = 6428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_380diff_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_380diff_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 = 6427; __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 = 6427; __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":6433
 *         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 = 6433; __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 = 6433; __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 = 6433; __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 = 6433; __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 = 6433; __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 = 6433; __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 = 6433; __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 = 6433; __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 = 6433; __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":6434
 * 
 *     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 = 6434; __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 = 6434; __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 = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":6435
 *     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":6436
 *     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":6437
 *         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":6439
 *                 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":6440
 *             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":6441
 *                 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":6442
 *             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":6444
 *                     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":6445
 *         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":6447
 *                 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":6448
 *             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":6449
 *                 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":6450
 *             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":6452
 *                     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":6453
 *     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":6454
 *         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":6456
 *                 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":6457
 *             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":6458
 *                 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":6459
 *             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":6461
 *                     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":6462
 *         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":6464
 *                 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":6465
 *             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":6466
 *                 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":6467
 *             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":6427
 * @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":6470
 * @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_383diff_2d_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_383diff_2d_int16 = {"diff_2d_int16", (PyCFunction)__pyx_pw_6pandas_5algos_383diff_2d_int16, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_383diff_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 = 6470; __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 = 6470; __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 = 6470; __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 = 6470; __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 = 6472; __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 = 6472; __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 = 6470; __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 = 6470; __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 = 6471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_382diff_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_382diff_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 = 6470; __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 = 6470; __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":6476
 *         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 = 6476; __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 = 6476; __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 = 6476; __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 = 6476; __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 = 6476; __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 = 6476; __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 = 6476; __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 = 6476; __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 = 6476; __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":6477
 * 
 *     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 = 6477; __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 = 6477; __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 = 6477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":6478
 *     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":6479
 *     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":6480
 *         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":6482
 *                 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":6483
 *             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":6484
 *                 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":6485
 *             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":6487
 *                     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":6488
 *         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":6490
 *                 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":6491
 *             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":6492
 *                 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":6493
 *             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":6495
 *                     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":6496
 *     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":6497
 *         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":6499
 *                 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":6500
 *             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":6501
 *                 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":6502
 *             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":6504
 *                     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":6505
 *         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":6507
 *                 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":6508
 *             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":6509
 *                 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":6510
 *             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":6470
 * @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":6513
 * @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_385diff_2d_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_385diff_2d_int32 = {"diff_2d_int32", (PyCFunction)__pyx_pw_6pandas_5algos_385diff_2d_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_385diff_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 = 6513; __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 = 6513; __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 = 6513; __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 = 6513; __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 = 6515; __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 = 6515; __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 = 6513; __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 = 6513; __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 = 6514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_384diff_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_384diff_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 = 6513; __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 = 6513; __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":6519
 *         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 = 6519; __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 = 6519; __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 = 6519; __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 = 6519; __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 = 6519; __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 = 6519; __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 = 6519; __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 = 6519; __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 = 6519; __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":6520
 * 
 *     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 = 6520; __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 = 6520; __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 = 6520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":6521
 *     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":6522
 *     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":6523
 *         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":6525
 *                 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":6526
 *             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":6527
 *                 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":6528
 *             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":6530
 *                     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":6531
 *         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":6533
 *                 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":6534
 *             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":6535
 *                 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":6536
 *             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":6538
 *                     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":6539
 *     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":6540
 *         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":6542
 *                 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":6543
 *             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":6544
 *                 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":6545
 *             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":6547
 *                     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":6548
 *         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":6550
 *                 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":6551
 *             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":6552
 *                 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":6553
 *             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":6513
 * @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":6556
 * @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_387diff_2d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_387diff_2d_int64 = {"diff_2d_int64", (PyCFunction)__pyx_pw_6pandas_5algos_387diff_2d_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_387diff_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 = 6556; __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 = 6556; __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 = 6556; __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 = 6556; __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 = 6558; __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 = 6558; __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 = 6556; __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 = 6556; __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 = 6557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_386diff_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_386diff_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 = 6556; __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 = 6556; __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":6562
 *         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 = 6562; __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 = 6562; __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 = 6562; __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 = 6562; __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 = 6562; __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 = 6562; __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 = 6562; __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 = 6562; __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 = 6562; __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":6563
 * 
 *     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 = 6563; __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 = 6563; __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 = 6563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "pandas/src/generated.pyx":6564
 *     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":6565
 *     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":6566
 *         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":6568
 *                 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":6569
 *             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":6570
 *                 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":6571
 *             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":6573
 *                     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":6574
 *         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":6576
 *                 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":6577
 *             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":6578
 *                 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":6579
 *             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":6581
 *                     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":6582
 *     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":6583
 *         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":6585
 *                 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":6586
 *             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":6587
 *                 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":6588
 *             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":6590
 *                     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":6591
 *         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":6593
 *                 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":6594
 *             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":6595
 *                 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":6596
 *             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_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":6556
 * @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":6600
 * @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_389group_add_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_388group_add_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_389group_add_float64 = {"group_add_float64", (PyCFunction)__pyx_pw_6pandas_5algos_389group_add_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_388group_add_float64};
static PyObject *__pyx_pw_6pandas_5algos_389group_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 = 6600; __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 = 6600; __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 = 6600; __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 = 6600; __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 = 6600; __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 = 6600; __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 = 6601; __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 = 6602; __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 = 6603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_388group_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_388group_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;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(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 = 6600; __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 = 6600; __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 = 6600; __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 = 6600; __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":6612
 *         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 = 6612; __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 = 6612; __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":6613
 * 
 *     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__258, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6613; __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 = 6613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":6615
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6615; __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 = 6615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 6615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":6616
 * 
 *     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 = 6616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6616; __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_7); __pyx_t_7 = 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 = 6616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.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_12, &__pyx_t_11, &__pyx_t_10);
      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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":6618
 *     sumx = 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 = 6618; __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 = 6618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6618; __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[2]; __pyx_lineno = 6618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_7 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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 = 6618; __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":6620
 *     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":6621
 * 
 *     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":6622
 *     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":6623
 *         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":6624
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":6626
 *                 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":6627
 * 
 *             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":6628
 *             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":6631
 * 
 *                 # 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":6632
 *                 # 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":6633
 *                 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":6635
 *                     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":6636
 *     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":6637
 *         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":6638
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L13_continue;
      }

      /* "pandas/src/generated.pyx":6640
 *                 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":6641
 * 
 *             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":6644
 * 
 *             # 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":6645
 *             # 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":6646
 *             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":6648
 *                 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 = 6648; __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":6649
 * 
 *     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":6650
 *     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":6651
 *         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":6653
 *                 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":6600
 * @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_7);
  { 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":6656
 * @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_391group_add_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_390group_add_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_391group_add_float32 = {"group_add_float32", (PyCFunction)__pyx_pw_6pandas_5algos_391group_add_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_390group_add_float32};
static PyObject *__pyx_pw_6pandas_5algos_391group_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 = 6656; __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 = 6656; __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 = 6656; __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 = 6656; __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 = 6656; __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 = 6656; __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 = 6657; __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 = 6658; __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 = 6659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_390group_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_390group_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;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(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 = 6656; __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 = 6656; __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 = 6656; __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 = 6656; __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":6668
 *         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 = 6668; __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 = 6668; __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":6669
 * 
 *     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__259, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6669; __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 = 6669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":6671
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6671; __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 = 6671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 6671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":6672
 * 
 *     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 = 6672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6672; __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_7); __pyx_t_7 = 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 = 6672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":6674
 *     sumx = 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 = 6674; __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 = 6674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6674; __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[2]; __pyx_lineno = 6674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_7 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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 = 6674; __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":6676
 *     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":6677
 * 
 *     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":6678
 *     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":6679
 *         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":6680
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":6682
 *                 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":6683
 * 
 *             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":6684
 *             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":6687
 * 
 *                 # 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":6688
 *                 # 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":6689
 *                 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":6691
 *                     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":6692
 *     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":6693
 *         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":6694
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L13_continue;
      }

      /* "pandas/src/generated.pyx":6696
 *                 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":6697
 * 
 *             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":6700
 * 
 *             # 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":6701
 *             # 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":6702
 *             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":6704
 *                 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 = 6704; __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":6705
 * 
 *     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":6706
 *     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":6707
 *         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":6709
 *                 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":6656
 * @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_7);
  { 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":6713
 * @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_393group_add_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_392group_add_bin_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_393group_add_bin_float64 = {"group_add_bin_float64", (PyCFunction)__pyx_pw_6pandas_5algos_393group_add_bin_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_392group_add_bin_float64};
static PyObject *__pyx_pw_6pandas_5algos_393group_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 = 6713; __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 = 6713; __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 = 6713; __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 = 6713; __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 = 6713; __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 = 6713; __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 = 6714; __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 = 6715; __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 = 6716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_392group_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_392group_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  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;
  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;
  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 = 6713; __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 = 6713; __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 = 6713; __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 = 6713; __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":6725
 *         ndarray[float64_t, ndim=2] sumx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6725; __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 = 6725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6725; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6725; __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_3); __pyx_t_3 = 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 = 6725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":6726
 * 
 *     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 = 6726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6726; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6726; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":6728
 *     sumx = np.zeros_like(out)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_10 - 1);
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_12) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":6729
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_12;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6731
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 *     N, K = (<object> values).shape
 * 
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_12 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":6732
 *     else:
 *         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 = 6732; __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 = 6732; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6732; __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_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_12;
  __pyx_v_K = __pyx_t_10;

  /* "pandas/src/generated.pyx":6734
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":6735
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_t_13 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":6736
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_10 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/generated.pyx":6737
 *     if K > 1:
 *         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) {
        } else {
          __pyx_t_13 = __pyx_t_15;
          goto __pyx_L11_bool_binop_done;
        }
        __pyx_t_16 = __pyx_v_b;
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_15;
        __pyx_L11_bool_binop_done:;
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":6738
 *         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":6740
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_17 = __pyx_v_b;
      *__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":6741
 * 
 *             counts[b] += 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":6742
 *             counts[b] += 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":6745
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 */
        __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":6746
 *                 # not nan
 *                 if val == val:
 *                     nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                     sumx[b, j] += val
 *     else:
 */
          __pyx_t_22 = __pyx_v_b;
          __pyx_t_23 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_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.0;

          /* "pandas/src/generated.pyx":6747
 *                 if val == val:
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
          __pyx_t_24 = __pyx_v_b;
          __pyx_t_25 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6749
 *                     sumx[b, j] += val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_10 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/generated.pyx":6750
 *     else:
 *         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) {
        } else {
          __pyx_t_13 = __pyx_t_15;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_18 = __pyx_v_b;
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_15;
        __pyx_L20_bool_binop_done:;
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":6751
 *         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":6753
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_19 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6754
 * 
 *             counts[b] += 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":6757
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 */
      __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":6758
 *             # not nan
 *             if val == val:
 *                 nobs[b, 0] += 1             # <<<<<<<<<<<<<<
 *                 sumx[b, 0] += val
 * 
 */
        __pyx_t_28 = __pyx_v_b;
        __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":6759
 *             if val == val:
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_30 = __pyx_v_b;
        __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;
        goto __pyx_L22;
      }
      __pyx_L22:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":6761
 *                 sumx[b, 0] += val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_10 = __pyx_v_ngroups;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":6762
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_32 = __pyx_v_K;
    for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) {
      __pyx_v_j = __pyx_t_33;

      /* "pandas/src/generated.pyx":6763
 *     for i in range(ngroups):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_34 = __pyx_v_i;
      __pyx_t_35 = __pyx_v_j;
      __pyx_t_13 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_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_13) {

        /* "pandas/src/generated.pyx":6764
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = sumx[i, j]
 */
        __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_L27;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":6766
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = sumx[i, j]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
        __pyx_t_38 = __pyx_v_i;
        __pyx_t_39 = __pyx_v_j;
        __pyx_t_40 = __pyx_v_i;
        __pyx_t_41 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_out.diminfo[1].strides) = (*__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));
      }
      __pyx_L27:;
    }
  }

  /* "pandas/src/generated.pyx":6713
 * @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_4);
  { 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":6769
 * @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_395group_add_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_394group_add_bin_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_395group_add_bin_float32 = {"group_add_bin_float32", (PyCFunction)__pyx_pw_6pandas_5algos_395group_add_bin_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_394group_add_bin_float32};
static PyObject *__pyx_pw_6pandas_5algos_395group_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 = 6769; __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 = 6769; __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 = 6769; __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 = 6769; __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 = 6769; __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 = 6769; __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 = 6770; __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 = 6771; __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 = 6772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_394group_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_394group_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  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;
  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;
  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 = 6769; __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 = 6769; __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 = 6769; __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 = 6769; __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":6781
 *         ndarray[float32_t, ndim=2] sumx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6781; __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 = 6781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6781; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6781; __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_3); __pyx_t_3 = 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 = 6781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":6782
 * 
 *     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 = 6782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6782; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6782; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":6784
 *     sumx = np.zeros_like(out)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_10 - 1);
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_12) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":6785
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_12;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6787
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 *     N, K = (<object> values).shape
 * 
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_12 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":6788
 *     else:
 *         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 = 6788; __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 = 6788; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6788; __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_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_12;
  __pyx_v_K = __pyx_t_10;

  /* "pandas/src/generated.pyx":6790
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":6791
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_t_13 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":6792
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_10 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/generated.pyx":6793
 *     if K > 1:
 *         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) {
        } else {
          __pyx_t_13 = __pyx_t_15;
          goto __pyx_L11_bool_binop_done;
        }
        __pyx_t_16 = __pyx_v_b;
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_15;
        __pyx_L11_bool_binop_done:;
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":6794
 *         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":6796
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_17 = __pyx_v_b;
      *__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":6797
 * 
 *             counts[b] += 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":6798
 *             counts[b] += 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":6801
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 */
        __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":6802
 *                 # not nan
 *                 if val == val:
 *                     nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                     sumx[b, j] += val
 *     else:
 */
          __pyx_t_22 = __pyx_v_b;
          __pyx_t_23 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_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.0;

          /* "pandas/src/generated.pyx":6803
 *                 if val == val:
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
          __pyx_t_24 = __pyx_v_b;
          __pyx_t_25 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6805
 *                     sumx[b, j] += val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_10 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/generated.pyx":6806
 *     else:
 *         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) {
        } else {
          __pyx_t_13 = __pyx_t_15;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_18 = __pyx_v_b;
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_15;
        __pyx_L20_bool_binop_done:;
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":6807
 *         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":6809
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_19 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6810
 * 
 *             counts[b] += 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":6813
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 */
      __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":6814
 *             # not nan
 *             if val == val:
 *                 nobs[b, 0] += 1             # <<<<<<<<<<<<<<
 *                 sumx[b, 0] += val
 * 
 */
        __pyx_t_28 = __pyx_v_b;
        __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":6815
 *             if val == val:
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_30 = __pyx_v_b;
        __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;
        goto __pyx_L22;
      }
      __pyx_L22:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":6817
 *                 sumx[b, 0] += val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_10 = __pyx_v_ngroups;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":6818
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_32 = __pyx_v_K;
    for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) {
      __pyx_v_j = __pyx_t_33;

      /* "pandas/src/generated.pyx":6819
 *     for i in range(ngroups):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_34 = __pyx_v_i;
      __pyx_t_35 = __pyx_v_j;
      __pyx_t_13 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_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_13) {

        /* "pandas/src/generated.pyx":6820
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = sumx[i, j]
 */
        __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_L27;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":6822
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = sumx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
        __pyx_t_38 = __pyx_v_i;
        __pyx_t_39 = __pyx_v_j;
        __pyx_t_40 = __pyx_v_i;
        __pyx_t_41 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_out.diminfo[1].strides) = (*__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));
      }
      __pyx_L27:;
    }
  }

  /* "pandas/src/generated.pyx":6769
 * @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_4);
  { 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":6826
 * @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_397group_prod_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_396group_prod_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_397group_prod_float64 = {"group_prod_float64", (PyCFunction)__pyx_pw_6pandas_5algos_397group_prod_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_396group_prod_float64};
static PyObject *__pyx_pw_6pandas_5algos_397group_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 = 6826; __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 = 6826; __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 = 6826; __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 = 6826; __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 = 6826; __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 = 6826; __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 = 6827; __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 = 6828; __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 = 6829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_396group_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_396group_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;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(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 = 6826; __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 = 6826; __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 = 6826; __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 = 6826; __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":6838
 *         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 = 6838; __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 = 6838; __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":6839
 * 
 *     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__260, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6839; __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 = 6839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":6841
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     prodx = np.ones_like(out)
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __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 = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":6842
 * 
 *     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 = 6842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ones_like); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6842; __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_7); __pyx_t_7 = 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 = 6842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.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_12, &__pyx_t_11, &__pyx_t_10);
      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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_prodx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":6844
 *     prodx = np.ones_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 = 6844; __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 = 6844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6844; __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[2]; __pyx_lineno = 6844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_7 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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 = 6844; __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":6846
 *     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":6847
 * 
 *     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":6848
 *     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":6849
 *         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":6850
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":6852
 *                 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":6853
 * 
 *             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":6854
 *             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":6857
 * 
 *                 # 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":6858
 *                 # 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":6859
 *                 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":6861
 *                     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":6862
 *     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":6863
 *         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":6864
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L13_continue;
      }

      /* "pandas/src/generated.pyx":6866
 *                 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":6867
 * 
 *             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":6870
 * 
 *             # 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":6871
 *             # 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":6872
 *             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":6874
 *                 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 = 6874; __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":6875
 * 
 *     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":6876
 *     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":6877
 *         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":6879
 *                 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":6826
 * @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_7);
  { 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":6882
 * @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_399group_prod_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_398group_prod_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_399group_prod_float32 = {"group_prod_float32", (PyCFunction)__pyx_pw_6pandas_5algos_399group_prod_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_398group_prod_float32};
static PyObject *__pyx_pw_6pandas_5algos_399group_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 = 6882; __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 = 6882; __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 = 6882; __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 = 6882; __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 = 6882; __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 = 6882; __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 = 6883; __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 = 6884; __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 = 6885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_398group_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_398group_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;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(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 = 6882; __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 = 6882; __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 = 6882; __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 = 6882; __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":6894
 *         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 = 6894; __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 = 6894; __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":6895
 * 
 *     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__261, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6895; __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 = 6895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":6897
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     prodx = np.ones_like(out)
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6897; __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 = 6897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 6897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":6898
 * 
 *     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 = 6898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ones_like); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6898; __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_7); __pyx_t_7 = 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 = 6898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_prodx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":6900
 *     prodx = np.ones_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 = 6900; __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 = 6900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6900; __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[2]; __pyx_lineno = 6900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_7 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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 = 6900; __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":6902
 *     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":6903
 * 
 *     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":6904
 *     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":6905
 *         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":6906
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":6908
 *                 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":6909
 * 
 *             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":6910
 *             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":6913
 * 
 *                 # 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":6914
 *                 # 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":6915
 *                 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":6917
 *                     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":6918
 *     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":6919
 *         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":6920
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L13_continue;
      }

      /* "pandas/src/generated.pyx":6922
 *                 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":6923
 * 
 *             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":6926
 * 
 *             # 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":6927
 *             # 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":6928
 *             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":6930
 *                 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 = 6930; __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":6931
 * 
 *     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":6932
 *     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":6933
 *         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":6935
 *                 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":6882
 * @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_7);
  { 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":6939
 * @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_401group_prod_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_400group_prod_bin_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_401group_prod_bin_float64 = {"group_prod_bin_float64", (PyCFunction)__pyx_pw_6pandas_5algos_401group_prod_bin_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_400group_prod_bin_float64};
static PyObject *__pyx_pw_6pandas_5algos_401group_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 = 6939; __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 = 6939; __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 = 6939; __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 = 6939; __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 = 6939; __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 = 6939; __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 = 6940; __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 = 6941; __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 = 6942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_400group_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_400group_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  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;
  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;
  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 = 6939; __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 = 6939; __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 = 6939; __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 = 6939; __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":6951
 *         ndarray[float64_t, ndim=2] prodx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     prodx = np.ones_like(out)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6951; __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 = 6951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6951; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6951; __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_3); __pyx_t_3 = 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 = 6951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":6952
 * 
 *     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 = 6952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6952; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6952; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_prodx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":6954
 *     prodx = np.ones_like(out)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_10 - 1);
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_12) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":6955
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_12;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6957
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 *     N, K = (<object> values).shape
 * 
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_12 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":6958
 *     else:
 *         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 = 6958; __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 = 6958; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6958; __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_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_12;
  __pyx_v_K = __pyx_t_10;

  /* "pandas/src/generated.pyx":6960
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":6961
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_t_13 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":6962
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_10 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/generated.pyx":6963
 *     if K > 1:
 *         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) {
        } else {
          __pyx_t_13 = __pyx_t_15;
          goto __pyx_L11_bool_binop_done;
        }
        __pyx_t_16 = __pyx_v_b;
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_15;
        __pyx_L11_bool_binop_done:;
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":6964
 *         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":6966
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_17 = __pyx_v_b;
      *__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":6967
 * 
 *             counts[b] += 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":6968
 *             counts[b] += 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":6971
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     prodx[b, j] *= val
 */
        __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":6972
 *                 # not nan
 *                 if val == val:
 *                     nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                     prodx[b, j] *= val
 *     else:
 */
          __pyx_t_22 = __pyx_v_b;
          __pyx_t_23 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_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.0;

          /* "pandas/src/generated.pyx":6973
 *                 if val == val:
 *                     nobs[b, j] += 1
 *                     prodx[b, j] *= val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
          __pyx_t_24 = __pyx_v_b;
          __pyx_t_25 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val;
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":6975
 *                     prodx[b, j] *= val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_10 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/generated.pyx":6976
 *     else:
 *         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) {
        } else {
          __pyx_t_13 = __pyx_t_15;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_18 = __pyx_v_b;
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_15;
        __pyx_L20_bool_binop_done:;
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":6977
 *         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":6979
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_19 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":6980
 * 
 *             counts[b] += 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":6983
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 prodx[b, 0] *= val
 */
      __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":6984
 *             # not nan
 *             if val == val:
 *                 nobs[b, 0] += 1             # <<<<<<<<<<<<<<
 *                 prodx[b, 0] *= val
 * 
 */
        __pyx_t_28 = __pyx_v_b;
        __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":6985
 *             if val == val:
 *                 nobs[b, 0] += 1
 *                 prodx[b, 0] *= val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_30 = __pyx_v_b;
        __pyx_t_31 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val;
        goto __pyx_L22;
      }
      __pyx_L22:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":6987
 *                 prodx[b, 0] *= val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_10 = __pyx_v_ngroups;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":6988
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_32 = __pyx_v_K;
    for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) {
      __pyx_v_j = __pyx_t_33;

      /* "pandas/src/generated.pyx":6989
 *     for i in range(ngroups):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_34 = __pyx_v_i;
      __pyx_t_35 = __pyx_v_j;
      __pyx_t_13 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_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_13) {

        /* "pandas/src/generated.pyx":6990
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = prodx[i, j]
 */
        __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_L27;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":6992
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = prodx[i, j]             # <<<<<<<<<<<<<<
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 */
        __pyx_t_38 = __pyx_v_i;
        __pyx_t_39 = __pyx_v_j;
        __pyx_t_40 = __pyx_v_i;
        __pyx_t_41 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_prodx.diminfo[1].strides));
      }
      __pyx_L27:;
    }
  }

  /* "pandas/src/generated.pyx":6939
 * @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_4);
  { 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":6995
 * @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_403group_prod_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_402group_prod_bin_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_403group_prod_bin_float32 = {"group_prod_bin_float32", (PyCFunction)__pyx_pw_6pandas_5algos_403group_prod_bin_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_402group_prod_bin_float32};
static PyObject *__pyx_pw_6pandas_5algos_403group_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 = 6995; __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 = 6995; __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 = 6995; __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 = 6995; __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 = 6995; __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 = 6995; __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 = 6996; __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 = 6997; __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 = 6998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_402group_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_402group_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  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;
  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;
  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 = 6995; __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 = 6995; __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 = 6995; __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 = 6995; __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":7007
 *         ndarray[float32_t, ndim=2] prodx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     prodx = np.ones_like(out)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7007; __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 = 7007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7007; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7007; __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_3); __pyx_t_3 = 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 = 7007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7008
 * 
 *     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 = 7008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7008; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7008; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_prodx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7010
 *     prodx = np.ones_like(out)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_10 - 1);
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_12) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":7011
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_12;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7013
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 *     N, K = (<object> values).shape
 * 
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_12 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":7014
 *     else:
 *         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 = 7014; __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 = 7014; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7014; __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_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_12;
  __pyx_v_K = __pyx_t_10;

  /* "pandas/src/generated.pyx":7016
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":7017
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_t_13 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":7018
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_10 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/generated.pyx":7019
 *     if K > 1:
 *         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) {
        } else {
          __pyx_t_13 = __pyx_t_15;
          goto __pyx_L11_bool_binop_done;
        }
        __pyx_t_16 = __pyx_v_b;
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_15;
        __pyx_L11_bool_binop_done:;
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":7020
 *         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":7022
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_17 = __pyx_v_b;
      *__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":7023
 * 
 *             counts[b] += 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":7024
 *             counts[b] += 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":7027
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     prodx[b, j] *= val
 */
        __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":7028
 *                 # not nan
 *                 if val == val:
 *                     nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                     prodx[b, j] *= val
 *     else:
 */
          __pyx_t_22 = __pyx_v_b;
          __pyx_t_23 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_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.0;

          /* "pandas/src/generated.pyx":7029
 *                 if val == val:
 *                     nobs[b, j] += 1
 *                     prodx[b, j] *= val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
          __pyx_t_24 = __pyx_v_b;
          __pyx_t_25 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val;
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7031
 *                     prodx[b, j] *= val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_10 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/generated.pyx":7032
 *     else:
 *         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) {
        } else {
          __pyx_t_13 = __pyx_t_15;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_18 = __pyx_v_b;
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_15;
        __pyx_L20_bool_binop_done:;
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":7033
 *         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":7035
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_19 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":7036
 * 
 *             counts[b] += 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":7039
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 prodx[b, 0] *= val
 */
      __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":7040
 *             # not nan
 *             if val == val:
 *                 nobs[b, 0] += 1             # <<<<<<<<<<<<<<
 *                 prodx[b, 0] *= val
 * 
 */
        __pyx_t_28 = __pyx_v_b;
        __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":7041
 *             if val == val:
 *                 nobs[b, 0] += 1
 *                 prodx[b, 0] *= val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_30 = __pyx_v_b;
        __pyx_t_31 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val;
        goto __pyx_L22;
      }
      __pyx_L22:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":7043
 *                 prodx[b, 0] *= val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_10 = __pyx_v_ngroups;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":7044
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_32 = __pyx_v_K;
    for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) {
      __pyx_v_j = __pyx_t_33;

      /* "pandas/src/generated.pyx":7045
 *     for i in range(ngroups):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_34 = __pyx_v_i;
      __pyx_t_35 = __pyx_v_j;
      __pyx_t_13 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_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_13) {

        /* "pandas/src/generated.pyx":7046
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = prodx[i, j]
 */
        __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_L27;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7048
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = prodx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_38 = __pyx_v_i;
        __pyx_t_39 = __pyx_v_j;
        __pyx_t_40 = __pyx_v_i;
        __pyx_t_41 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_prodx.diminfo[1].strides));
      }
      __pyx_L27:;
    }
  }

  /* "pandas/src/generated.pyx":6995
 * @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_4);
  { 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":7052
 * @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_405group_var_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_405group_var_float64 = {"group_var_float64", (PyCFunction)__pyx_pw_6pandas_5algos_405group_var_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_405group_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 = 7052; __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 = 7052; __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 = 7052; __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 = 7052; __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 = 7052; __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 = 7052; __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 = 7053; __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 = 7054; __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 = 7055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_404group_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_404group_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;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(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 = 7052; __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 = 7052; __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 = 7052; __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 = 7052; __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":7061
 *         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 = 7061; __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 = 7061; __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":7062
 * 
 *     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__262, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7062; __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 = 7062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":7064
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 *     sumxx = np.zeros_like(out)
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7064; __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 = 7064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 7064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":7065
 * 
 *     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 = 7065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7065; __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_7); __pyx_t_7 = 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 = 7065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.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_12, &__pyx_t_11, &__pyx_t_10);
      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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":7066
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)
 *     sumxx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __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 = 7066; __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 = 7066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":7068
 *     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 = 7068; __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 = 7068; __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 = 7068; __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 = 7068; __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_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_7)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_13(__pyx_t_7); 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_7); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7068; __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 = 7068; __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 = 7068; __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":7070
 *     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":7071
 * 
 *     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":7073
 *         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":7074
 * 
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":7075
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":7077
 *                 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":7079
 *             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":7080
 * 
 *             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":7083
 * 
 *                 # 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":7084
 *                 # 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":7085
 *                 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":7086
 *                     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":7088
 *                     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":7090
 *         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":7091
 * 
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":7092
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L13_continue;
      }

      /* "pandas/src/generated.pyx":7094
 *                 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":7095
 * 
 *             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":7097
 *             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":7098
 *             # 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":7099
 *             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":7100
 *                 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":7103
 * 
 * 
 *     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 = 7103; __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":7104
 * 
 *     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":7105
 *     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":7106
 *         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":7107
 *             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":7109
 *                 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":7110
 *             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":7109
 *                 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 = 7109; __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":7052
 * @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_7);
  { 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":7113
 * @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_407group_var_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_407group_var_float32 = {"group_var_float32", (PyCFunction)__pyx_pw_6pandas_5algos_407group_var_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_407group_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 = 7113; __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 = 7113; __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 = 7113; __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 = 7113; __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 = 7113; __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 = 7113; __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 = 7114; __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 = 7115; __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 = 7116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_406group_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_406group_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;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(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 = 7113; __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 = 7113; __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 = 7113; __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 = 7113; __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":7122
 *         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 = 7122; __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 = 7122; __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":7123
 * 
 *     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__263, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7123; __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 = 7123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":7125
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 *     sumxx = np.zeros_like(out)
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7125; __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 = 7125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 7125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":7126
 * 
 *     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 = 7126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7126; __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_7); __pyx_t_7 = 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 = 7126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":7127
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)
 *     sumxx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __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 = 7127; __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 = 7127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":7129
 *     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 = 7129; __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 = 7129; __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 = 7129; __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 = 7129; __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_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_7)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_13(__pyx_t_7); 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_7); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7129; __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 = 7129; __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 = 7129; __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":7131
 *     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":7132
 * 
 *     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":7134
 *         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":7135
 * 
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":7136
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":7138
 *                 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":7140
 *             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":7141
 * 
 *             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":7144
 * 
 *                 # 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":7145
 *                 # 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":7146
 *                 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":7147
 *                     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":7149
 *                     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":7151
 *         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":7152
 * 
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_lab < 0) != 0);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":7153
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L13_continue;
      }

      /* "pandas/src/generated.pyx":7155
 *                 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":7156
 * 
 *             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":7158
 *             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":7159
 *             # 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":7160
 *             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":7161
 *                 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":7164
 * 
 * 
 *     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 = 7164; __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":7165
 * 
 *     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":7166
 *     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":7167
 *         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":7168
 *             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":7170
 *                 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":7171
 *             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":7170
 *                 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 = 7170; __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":7113
 * @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_7);
  { 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":7175
 * @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_409group_var_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_409group_var_bin_float64 = {"group_var_bin_float64", (PyCFunction)__pyx_pw_6pandas_5algos_409group_var_bin_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_409group_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 = 7175; __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 = 7175; __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 = 7175; __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 = 7175; __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 = 7175; __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 = 7175; __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 = 7176; __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 = 7177; __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 = 7178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_408group_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_408group_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __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;
  long __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;
  __pyx_t_5numpy_float64_t __pyx_t_48;
  __pyx_t_5numpy_float64_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("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 = 7175; __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 = 7175; __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 = 7175; __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 = 7175; __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":7185
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __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 = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __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_3); __pyx_t_3 = 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 = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7186
 * 
 *     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 = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7187
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)
 *     sumxx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __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 = 7187; __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 = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7189
 *     sumxx = np.zeros_like(out)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_10 - 1);
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_12) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":7190
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_12;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7192
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_12 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":7194
 *         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 = 7194; __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 = 7194; __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 = 7194; __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 = 7194; __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 = 7194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_4); 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_4); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7194; __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[2]; __pyx_lineno = 7194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_N = __pyx_t_12;
  __pyx_v_K = __pyx_t_10;

  /* "pandas/src/generated.pyx":7196
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":7197
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_t_13 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":7198
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_10 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/generated.pyx":7199
 *     if K > 1:
 *         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) {
        } else {
          __pyx_t_13 = __pyx_t_15;
          goto __pyx_L11_bool_binop_done;
        }
        __pyx_t_16 = __pyx_v_b;
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_15;
        __pyx_L11_bool_binop_done:;
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":7200
 *         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":7202
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 * 
 *             for j in range(K):
 */
      __pyx_t_17 = __pyx_v_b;
      *__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":7204
 *             counts[b] += 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":7205
 * 
 *             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":7208
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 */
        __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":7209
 *                 # not nan
 *                 if val == val:
 *                     nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                     sumx[b, j] += val
 *                     sumxx[b, j] += val * val
 */
          __pyx_t_22 = __pyx_v_b;
          __pyx_t_23 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_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.0;

          /* "pandas/src/generated.pyx":7210
 *                 if val == val:
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val             # <<<<<<<<<<<<<<
 *                     sumxx[b, j] += val * val
 *     else:
 */
          __pyx_t_24 = __pyx_v_b;
          __pyx_t_25 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;

          /* "pandas/src/generated.pyx":7211
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 *                     sumxx[b, j] += val * val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
          __pyx_t_26 = __pyx_v_b;
          __pyx_t_27 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val);
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7213
 *                     sumxx[b, j] += val * val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_10 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/generated.pyx":7214
 *     else:
 *         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) {
        } else {
          __pyx_t_13 = __pyx_t_15;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_18 = __pyx_v_b;
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_15;
        __pyx_L20_bool_binop_done:;
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":7215
 *         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":7217
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_19 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":7218
 * 
 *             counts[b] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_28 = __pyx_v_i;
      __pyx_t_29 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":7221
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 */
      __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":7222
 *             # not nan
 *             if val == val:
 *                 nobs[b, 0] += 1             # <<<<<<<<<<<<<<
 *                 sumx[b, 0] += val
 *                 sumxx[b, 0] += val * val
 */
        __pyx_t_30 = __pyx_v_b;
        __pyx_t_31 = 0;
        *__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) += 1.0;

        /* "pandas/src/generated.pyx":7223
 *             if val == val:
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val             # <<<<<<<<<<<<<<
 *                 sumxx[b, 0] += val * val
 * 
 */
        __pyx_t_32 = __pyx_v_b;
        __pyx_t_33 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;

        /* "pandas/src/generated.pyx":7224
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 *                 sumxx[b, 0] += val * val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_34 = __pyx_v_b;
        __pyx_t_35 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val);
        goto __pyx_L22;
      }
      __pyx_L22:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":7226
 *                 sumxx[b, 0] += val * val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             ct = nobs[i, j]
 */
  __pyx_t_10 = __pyx_v_ngroups;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":7227
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             ct = nobs[i, j]
 *             if ct < 2:
 */
    __pyx_t_36 = __pyx_v_K;
    for (__pyx_t_37 = 0; __pyx_t_37 < __pyx_t_36; __pyx_t_37+=1) {
      __pyx_v_j = __pyx_t_37;

      /* "pandas/src/generated.pyx":7228
 *     for i in range(ngroups):
 *         for j in range(K):
 *             ct = nobs[i, j]             # <<<<<<<<<<<<<<
 *             if ct < 2:
 *                 out[i, j] = nan
 */
      __pyx_t_38 = __pyx_v_i;
      __pyx_t_39 = __pyx_v_j;
      __pyx_v_ct = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[1].strides));

      /* "pandas/src/generated.pyx":7229
 *         for j in range(K):
 *             ct = nobs[i, j]
 *             if ct < 2:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_13 = ((__pyx_v_ct < 2.0) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":7230
 *             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_40 = __pyx_v_i;
        __pyx_t_41 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L27;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7232
 *                 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_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_i;
        __pyx_t_47 = __pyx_v_j;
        __pyx_t_48 = ((__pyx_v_ct * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_sumxx.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)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_sumx.diminfo[1].strides))));

        /* "pandas/src/generated.pyx":7233
 *             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_49 = ((__pyx_v_ct * __pyx_v_ct) - __pyx_v_ct);

        /* "pandas/src/generated.pyx":7232
 *                 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_49 == 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 = 7232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_50 = __pyx_v_i;
        __pyx_t_51 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_48 / __pyx_t_49);
      }
      __pyx_L27:;
    }
  }

  /* "pandas/src/generated.pyx":7175
 * @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_4);
  { 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":7236
 * @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_411group_var_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_411group_var_bin_float32 = {"group_var_bin_float32", (PyCFunction)__pyx_pw_6pandas_5algos_411group_var_bin_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_411group_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 = 7236; __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 = 7236; __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 = 7236; __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 = 7236; __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 = 7236; __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 = 7236; __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 = 7237; __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 = 7238; __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 = 7239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_410group_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_410group_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __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;
  long __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;
  __pyx_t_5numpy_float32_t __pyx_t_48;
  __pyx_t_5numpy_float32_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("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 = 7236; __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 = 7236; __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 = 7236; __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 = 7236; __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":7246
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7246; __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 = 7246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7246; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7246; __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_3); __pyx_t_3 = 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 = 7246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7247
 * 
 *     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 = 7247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7247; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7247; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7248
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)
 *     sumxx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7248; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __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 = 7248; __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 = 7248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7250
 *     sumxx = np.zeros_like(out)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_10 - 1);
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_12) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":7251
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_12;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7253
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_12 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":7255
 *         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 = 7255; __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 = 7255; __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 = 7255; __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 = 7255; __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 = 7255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_4); 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_4); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7255; __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[2]; __pyx_lineno = 7255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_N = __pyx_t_12;
  __pyx_v_K = __pyx_t_10;

  /* "pandas/src/generated.pyx":7257
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":7258
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_t_13 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":7259
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_10 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/generated.pyx":7260
 *     if K > 1:
 *         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) {
        } else {
          __pyx_t_13 = __pyx_t_15;
          goto __pyx_L11_bool_binop_done;
        }
        __pyx_t_16 = __pyx_v_b;
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_15;
        __pyx_L11_bool_binop_done:;
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":7261
 *         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":7263
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 * 
 *             for j in range(K):
 */
      __pyx_t_17 = __pyx_v_b;
      *__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":7265
 *             counts[b] += 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":7266
 * 
 *             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":7269
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 */
        __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":7270
 *                 # not nan
 *                 if val == val:
 *                     nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                     sumx[b, j] += val
 *                     sumxx[b, j] += val * val
 */
          __pyx_t_22 = __pyx_v_b;
          __pyx_t_23 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_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.0;

          /* "pandas/src/generated.pyx":7271
 *                 if val == val:
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val             # <<<<<<<<<<<<<<
 *                     sumxx[b, j] += val * val
 *     else:
 */
          __pyx_t_24 = __pyx_v_b;
          __pyx_t_25 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;

          /* "pandas/src/generated.pyx":7272
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 *                     sumxx[b, j] += val * val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
          __pyx_t_26 = __pyx_v_b;
          __pyx_t_27 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val);
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7274
 *                     sumxx[b, j] += val * val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_10 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/generated.pyx":7275
 *     else:
 *         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) {
        } else {
          __pyx_t_13 = __pyx_t_15;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_18 = __pyx_v_b;
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_15;
        __pyx_L20_bool_binop_done:;
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":7276
 *         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":7278
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_19 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":7279
 * 
 *             counts[b] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_28 = __pyx_v_i;
      __pyx_t_29 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":7282
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 */
      __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":7283
 *             # not nan
 *             if val == val:
 *                 nobs[b, 0] += 1             # <<<<<<<<<<<<<<
 *                 sumx[b, 0] += val
 *                 sumxx[b, 0] += val * val
 */
        __pyx_t_30 = __pyx_v_b;
        __pyx_t_31 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_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) += 1.0;

        /* "pandas/src/generated.pyx":7284
 *             if val == val:
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val             # <<<<<<<<<<<<<<
 *                 sumxx[b, 0] += val * val
 * 
 */
        __pyx_t_32 = __pyx_v_b;
        __pyx_t_33 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;

        /* "pandas/src/generated.pyx":7285
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 *                 sumxx[b, 0] += val * val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_34 = __pyx_v_b;
        __pyx_t_35 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val);
        goto __pyx_L22;
      }
      __pyx_L22:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":7287
 *                 sumxx[b, 0] += val * val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             ct = nobs[i, j]
 */
  __pyx_t_10 = __pyx_v_ngroups;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":7288
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             ct = nobs[i, j]
 *             if ct < 2:
 */
    __pyx_t_36 = __pyx_v_K;
    for (__pyx_t_37 = 0; __pyx_t_37 < __pyx_t_36; __pyx_t_37+=1) {
      __pyx_v_j = __pyx_t_37;

      /* "pandas/src/generated.pyx":7289
 *     for i in range(ngroups):
 *         for j in range(K):
 *             ct = nobs[i, j]             # <<<<<<<<<<<<<<
 *             if ct < 2:
 *                 out[i, j] = nan
 */
      __pyx_t_38 = __pyx_v_i;
      __pyx_t_39 = __pyx_v_j;
      __pyx_v_ct = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[1].strides));

      /* "pandas/src/generated.pyx":7290
 *         for j in range(K):
 *             ct = nobs[i, j]
 *             if ct < 2:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_13 = ((__pyx_v_ct < 2.0) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":7291
 *             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_40 = __pyx_v_i;
        __pyx_t_41 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan;
        goto __pyx_L27;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7293
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /             # <<<<<<<<<<<<<<
 *                              (ct * ct - ct))
 * 
 */
        __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_i;
        __pyx_t_47 = __pyx_v_j;
        __pyx_t_48 = ((__pyx_v_ct * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_sumxx.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)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_sumx.diminfo[1].strides))));

        /* "pandas/src/generated.pyx":7294
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /
 *                              (ct * ct - ct))             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_49 = ((__pyx_v_ct * __pyx_v_ct) - __pyx_v_ct);

        /* "pandas/src/generated.pyx":7293
 *                 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_49 == 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 = 7293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_50 = __pyx_v_i;
        __pyx_t_51 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_48 / __pyx_t_49);
      }
      __pyx_L27:;
    }
  }

  /* "pandas/src/generated.pyx":7236
 * @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_4);
  { 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":7298
 * @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_413group_mean_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_413group_mean_float64 = {"group_mean_float64", (PyCFunction)__pyx_pw_6pandas_5algos_413group_mean_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_413group_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 = 7298; __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 = 7298; __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 = 7298; __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 = 7298; __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 = 7298; __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 = 7298; __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 = 7299; __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 = 7300; __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 = 7301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_412group_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_412group_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;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(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 = 7298; __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 = 7298; __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 = 7298; __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 = 7298; __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":7307
 *         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 = 7307; __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 = 7307; __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":7308
 * 
 *     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__264, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7308; __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 = 7308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":7310
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7310; __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 = 7310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 7310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":7311
 * 
 *     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 = 7311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7311; __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_7); __pyx_t_7 = 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 = 7311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.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_12, &__pyx_t_11, &__pyx_t_10);
      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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":7313
 *     sumx = 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 = 7313; __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 = 7313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7313; __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[2]; __pyx_lineno = 7313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_7 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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 = 7313; __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":7315
 *     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":7316
 * 
 *     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":7317
 *     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":7318
 *         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":7319
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":7321
 *                 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":7322
 * 
 *             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":7323
 *             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":7325
 *                 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":7326
 *                 # 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":7327
 *                 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":7329
 *                     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":7330
 *     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":7331
 *         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":7332
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L13_continue;
      }

      /* "pandas/src/generated.pyx":7334
 *                 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":7335
 * 
 *             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":7337
 *             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":7338
 *             # 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":7339
 *             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":7341
 *                 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 = 7341; __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":7342
 * 
 *     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":7343
 *     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":7344
 *         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":7345
 *             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":7347
 *                 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 = 7347; __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":7298
 * @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_7);
  { 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":7350
 * @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_415group_mean_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_415group_mean_float32 = {"group_mean_float32", (PyCFunction)__pyx_pw_6pandas_5algos_415group_mean_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_415group_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 = 7350; __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 = 7350; __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 = 7350; __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 = 7350; __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 = 7350; __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 = 7350; __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 = 7351; __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 = 7352; __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 = 7353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_414group_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_414group_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;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(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 = 7350; __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 = 7350; __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 = 7350; __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 = 7350; __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":7359
 *         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 = 7359; __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 = 7359; __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":7360
 * 
 *     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__265, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7360; __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 = 7360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":7362
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7362; __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 = 7362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 7362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":7363
 * 
 *     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 = 7363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7363; __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_7); __pyx_t_7 = 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 = 7363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":7365
 *     sumx = 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 = 7365; __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 = 7365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7365; __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[2]; __pyx_lineno = 7365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_7 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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 = 7365; __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":7367
 *     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":7368
 * 
 *     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":7369
 *     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":7370
 *         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":7371
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":7373
 *                 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":7374
 * 
 *             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":7375
 *             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":7377
 *                 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":7378
 *                 # 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":7379
 *                 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":7381
 *                     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":7382
 *     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":7383
 *         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":7384
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L13_continue;
      }

      /* "pandas/src/generated.pyx":7386
 *                 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":7387
 * 
 *             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":7389
 *             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":7390
 *             # 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":7391
 *             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":7393
 *                 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 = 7393; __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":7394
 * 
 *     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":7395
 *     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":7396
 *         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":7397
 *             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":7399
 *                 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 = 7399; __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":7350
 * @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_7);
  { 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":7402
 * 
 * 
 * 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_417group_mean_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_417group_mean_bin_float64 = {"group_mean_bin_float64", (PyCFunction)__pyx_pw_6pandas_5algos_417group_mean_bin_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_417group_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 = 7402; __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 = 7402; __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 = 7402; __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 = 7402; __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 = 7402; __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 = 7402; __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 = 7403; __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 = 7404; __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 = 7405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_416group_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_416group_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  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;
  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_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 = 7402; __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 = 7402; __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 = 7402; __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 = 7402; __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":7411
 *         ndarray[float64_t, ndim=2] sumx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7411; __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 = 7411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7411; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7411; __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_3); __pyx_t_3 = 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 = 7411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7412
 * 
 *     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 = 7412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7412; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7412; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7414
 *     sumx = np.zeros_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)
 */
  __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 = 7414; __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 = 7414; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7414; __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_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_2 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_11;
  __pyx_v_K = __pyx_t_12;

  /* "pandas/src/generated.pyx":7415
 * 
 *     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 = 7415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_12 - 1);
  __pyx_t_6 = -1;
  if (__pyx_t_11 < 0) {
    __pyx_t_11 += __pyx_pybuffernd_bins.diminfo[0].shape;
    if (unlikely(__pyx_t_11 < 0)) __pyx_t_6 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_6 = 0;
  if (unlikely(__pyx_t_6 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_6);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7415; __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 = 7415; __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":7416
 *     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 = 7416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_13;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7418
 *         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 = 7418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_13 + 1);
  }
  __pyx_L5:;

  /* "pandas/src/generated.pyx":7420
 *         ngroups = len(bins) + 1
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":7421
 * 
 *     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":7422
 *     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":7423
 *     if K > 1:
 *         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) {
        } else {
          __pyx_t_14 = __pyx_t_15;
          goto __pyx_L11_bool_binop_done;
        }
        __pyx_t_16 = __pyx_v_b;
        __pyx_t_6 = -1;
        if (__pyx_t_16 < 0) {
          __pyx_t_16 += __pyx_pybuffernd_bins.diminfo[0].shape;
          if (unlikely(__pyx_t_16 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_6 = 0;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_14 = __pyx_t_15;
        __pyx_L11_bool_binop_done:;
        if (!__pyx_t_14) break;

        /* "pandas/src/generated.pyx":7424
 *         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":7426
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_17 = __pyx_v_b;
      __pyx_t_6 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_counts.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_17 >= __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[2]; __pyx_lineno = 7426; __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":7427
 * 
 *             counts[b] += 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":7428
 *             counts[b] += 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_6 = -1;
        if (__pyx_t_20 < 0) {
          __pyx_t_20 += __pyx_pybuffernd_values.diminfo[0].shape;
          if (unlikely(__pyx_t_20 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_21 < 0) {
          __pyx_t_21 += __pyx_pybuffernd_values.diminfo[1].shape;
          if (unlikely(__pyx_t_21 < 0)) __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7428; __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":7431
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 */
        __pyx_t_14 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_14) {

          /* "pandas/src/generated.pyx":7432
 *                 # not nan
 *                 if val == val:
 *                     nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                     sumx[b, j] += val
 *     else:
 */
          __pyx_t_22 = __pyx_v_b;
          __pyx_t_23 = __pyx_v_j;
          __pyx_t_6 = -1;
          if (__pyx_t_22 < 0) {
            __pyx_t_22 += __pyx_pybuffernd_nobs.diminfo[0].shape;
            if (unlikely(__pyx_t_22 < 0)) __pyx_t_6 = 0;
          } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_6 = 0;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_pybuffernd_nobs.diminfo[1].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_6 = 1;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_6 = 1;
          if (unlikely(__pyx_t_6 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_6);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_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.0;

          /* "pandas/src/generated.pyx":7433
 *                 if val == val:
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
          __pyx_t_24 = __pyx_v_b;
          __pyx_t_25 = __pyx_v_j;
          __pyx_t_6 = -1;
          if (__pyx_t_24 < 0) {
            __pyx_t_24 += __pyx_pybuffernd_sumx.diminfo[0].shape;
            if (unlikely(__pyx_t_24 < 0)) __pyx_t_6 = 0;
          } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_6 = 0;
          if (__pyx_t_25 < 0) {
            __pyx_t_25 += __pyx_pybuffernd_sumx.diminfo[1].shape;
            if (unlikely(__pyx_t_25 < 0)) __pyx_t_6 = 1;
          } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_6 = 1;
          if (unlikely(__pyx_t_6 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_6);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7435
 *                     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":7436
 *     else:
 *         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) {
        } else {
          __pyx_t_14 = __pyx_t_15;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_18 = __pyx_v_b;
        __pyx_t_6 = -1;
        if (__pyx_t_18 < 0) {
          __pyx_t_18 += __pyx_pybuffernd_bins.diminfo[0].shape;
          if (unlikely(__pyx_t_18 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_6 = 0;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_14 = __pyx_t_15;
        __pyx_L20_bool_binop_done:;
        if (!__pyx_t_14) break;

        /* "pandas/src/generated.pyx":7437
 *         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":7439
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_19 = __pyx_v_b;
      __pyx_t_6 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_pybuffernd_counts.diminfo[0].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_19 >= __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[2]; __pyx_lineno = 7439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":7440
 * 
 *             counts[b] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_26 = __pyx_v_i;
      __pyx_t_27 = 0;
      __pyx_t_6 = -1;
      if (__pyx_t_26 < 0) {
        __pyx_t_26 += __pyx_pybuffernd_values.diminfo[0].shape;
        if (unlikely(__pyx_t_26 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_6 = 0;
      if (__pyx_t_27 < 0) {
        __pyx_t_27 += __pyx_pybuffernd_values.diminfo[1].shape;
        if (unlikely(__pyx_t_27 < 0)) __pyx_t_6 = 1;
      } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_6 = 1;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7440; __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_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":7443
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 */
      __pyx_t_14 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_14) {

        /* "pandas/src/generated.pyx":7444
 *             # not nan
 *             if val == val:
 *                 nobs[b, 0] += 1             # <<<<<<<<<<<<<<
 *                 sumx[b, 0] += val
 * 
 */
        __pyx_t_28 = __pyx_v_b;
        __pyx_t_29 = 0;
        __pyx_t_6 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_28 += __pyx_pybuffernd_nobs.diminfo[0].shape;
          if (unlikely(__pyx_t_28 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_29 < 0) {
          __pyx_t_29 += __pyx_pybuffernd_nobs.diminfo[1].shape;
          if (unlikely(__pyx_t_29 < 0)) __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__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":7445
 *             if val == val:
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_30 = __pyx_v_b;
        __pyx_t_31 = 0;
        __pyx_t_6 = -1;
        if (__pyx_t_30 < 0) {
          __pyx_t_30 += __pyx_pybuffernd_sumx.diminfo[0].shape;
          if (unlikely(__pyx_t_30 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_31 < 0) {
          __pyx_t_31 += __pyx_pybuffernd_sumx.diminfo[1].shape;
          if (unlikely(__pyx_t_31 < 0)) __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__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;
        goto __pyx_L22;
      }
      __pyx_L22:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":7447
 *                 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":7448
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             count = nobs[i, j]
 *             if count == 0:
 */
    __pyx_t_32 = __pyx_v_K;
    for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) {
      __pyx_v_j = __pyx_t_33;

      /* "pandas/src/generated.pyx":7449
 *     for i in range(ngroups):
 *         for j in range(K):
 *             count = nobs[i, j]             # <<<<<<<<<<<<<<
 *             if count == 0:
 *                 out[i, j] = nan
 */
      __pyx_t_34 = __pyx_v_i;
      __pyx_t_35 = __pyx_v_j;
      __pyx_t_6 = -1;
      if (__pyx_t_34 < 0) {
        __pyx_t_34 += __pyx_pybuffernd_nobs.diminfo[0].shape;
        if (unlikely(__pyx_t_34 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_6 = 0;
      if (__pyx_t_35 < 0) {
        __pyx_t_35 += __pyx_pybuffernd_nobs.diminfo[1].shape;
        if (unlikely(__pyx_t_35 < 0)) __pyx_t_6 = 1;
      } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_6 = 1;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7449; __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_34, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[1].strides));

      /* "pandas/src/generated.pyx":7450
 *         for j in range(K):
 *             count = nobs[i, j]
 *             if count == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_14 = ((__pyx_v_count == 0.0) != 0);
      if (__pyx_t_14) {

        /* "pandas/src/generated.pyx":7451
 *             count = nobs[i, j]
 *             if count == 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_t_6 = -1;
        if (__pyx_t_36 < 0) {
          __pyx_t_36 += __pyx_pybuffernd_out.diminfo[0].shape;
          if (unlikely(__pyx_t_36 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_37 < 0) {
          __pyx_t_37 += __pyx_pybuffernd_out.diminfo[1].shape;
          if (unlikely(__pyx_t_37 < 0)) __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__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_L27;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7453
 *                 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_38 = __pyx_v_i;
        __pyx_t_39 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_38 < 0) {
          __pyx_t_38 += __pyx_pybuffernd_sumx.diminfo[0].shape;
          if (unlikely(__pyx_t_38 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_39 < 0) {
          __pyx_t_39 += __pyx_pybuffernd_sumx.diminfo[1].shape;
          if (unlikely(__pyx_t_39 < 0)) __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __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 = 7453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_41 = __pyx_v_i;
        __pyx_t_42 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_41 < 0) {
          __pyx_t_41 += __pyx_pybuffernd_out.diminfo[0].shape;
          if (unlikely(__pyx_t_41 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_42 < 0) {
          __pyx_t_42 += __pyx_pybuffernd_out.diminfo[1].shape;
          if (unlikely(__pyx_t_42 < 0)) __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__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_L27:;
    }
  }

  /* "pandas/src/generated.pyx":7402
 * 
 * 
 * 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_4);
  { 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":7455
 *                 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_419group_mean_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_419group_mean_bin_float32 = {"group_mean_bin_float32", (PyCFunction)__pyx_pw_6pandas_5algos_419group_mean_bin_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_419group_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 = 7455; __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 = 7455; __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 = 7455; __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 = 7455; __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 = 7455; __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 = 7455; __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 = 7456; __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 = 7457; __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 = 7458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_418group_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_418group_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  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;
  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_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 = 7455; __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 = 7455; __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 = 7455; __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 = 7455; __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":7464
 *         ndarray[float32_t, ndim=2] sumx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7464; __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 = 7464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7464; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7464; __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_3); __pyx_t_3 = 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 = 7464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7465
 * 
 *     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 = 7465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7465; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7465; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7467
 *     sumx = np.zeros_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)
 */
  __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 = 7467; __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 = 7467; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7467; __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_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_2 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_11;
  __pyx_v_K = __pyx_t_12;

  /* "pandas/src/generated.pyx":7468
 * 
 *     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 = 7468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_12 - 1);
  __pyx_t_6 = -1;
  if (__pyx_t_11 < 0) {
    __pyx_t_11 += __pyx_pybuffernd_bins.diminfo[0].shape;
    if (unlikely(__pyx_t_11 < 0)) __pyx_t_6 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_6 = 0;
  if (unlikely(__pyx_t_6 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_6);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7468; __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 = 7468; __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":7469
 *     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 = 7469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_13;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7471
 *         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 = 7471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_13 + 1);
  }
  __pyx_L5:;

  /* "pandas/src/generated.pyx":7473
 *         ngroups = len(bins) + 1
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":7474
 * 
 *     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":7475
 *     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":7476
 *     if K > 1:
 *         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) {
        } else {
          __pyx_t_14 = __pyx_t_15;
          goto __pyx_L11_bool_binop_done;
        }
        __pyx_t_16 = __pyx_v_b;
        __pyx_t_6 = -1;
        if (__pyx_t_16 < 0) {
          __pyx_t_16 += __pyx_pybuffernd_bins.diminfo[0].shape;
          if (unlikely(__pyx_t_16 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_6 = 0;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_14 = __pyx_t_15;
        __pyx_L11_bool_binop_done:;
        if (!__pyx_t_14) break;

        /* "pandas/src/generated.pyx":7477
 *         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":7479
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_17 = __pyx_v_b;
      __pyx_t_6 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_counts.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_17 >= __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[2]; __pyx_lineno = 7479; __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":7480
 * 
 *             counts[b] += 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":7481
 *             counts[b] += 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_6 = -1;
        if (__pyx_t_20 < 0) {
          __pyx_t_20 += __pyx_pybuffernd_values.diminfo[0].shape;
          if (unlikely(__pyx_t_20 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_21 < 0) {
          __pyx_t_21 += __pyx_pybuffernd_values.diminfo[1].shape;
          if (unlikely(__pyx_t_21 < 0)) __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7481; __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":7484
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 */
        __pyx_t_14 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_14) {

          /* "pandas/src/generated.pyx":7485
 *                 # not nan
 *                 if val == val:
 *                     nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                     sumx[b, j] += val
 *     else:
 */
          __pyx_t_22 = __pyx_v_b;
          __pyx_t_23 = __pyx_v_j;
          __pyx_t_6 = -1;
          if (__pyx_t_22 < 0) {
            __pyx_t_22 += __pyx_pybuffernd_nobs.diminfo[0].shape;
            if (unlikely(__pyx_t_22 < 0)) __pyx_t_6 = 0;
          } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_6 = 0;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_pybuffernd_nobs.diminfo[1].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_6 = 1;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_6 = 1;
          if (unlikely(__pyx_t_6 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_6);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_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.0;

          /* "pandas/src/generated.pyx":7486
 *                 if val == val:
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
          __pyx_t_24 = __pyx_v_b;
          __pyx_t_25 = __pyx_v_j;
          __pyx_t_6 = -1;
          if (__pyx_t_24 < 0) {
            __pyx_t_24 += __pyx_pybuffernd_sumx.diminfo[0].shape;
            if (unlikely(__pyx_t_24 < 0)) __pyx_t_6 = 0;
          } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_6 = 0;
          if (__pyx_t_25 < 0) {
            __pyx_t_25 += __pyx_pybuffernd_sumx.diminfo[1].shape;
            if (unlikely(__pyx_t_25 < 0)) __pyx_t_6 = 1;
          } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_6 = 1;
          if (unlikely(__pyx_t_6 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_6);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val;
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7488
 *                     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":7489
 *     else:
 *         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) {
        } else {
          __pyx_t_14 = __pyx_t_15;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_18 = __pyx_v_b;
        __pyx_t_6 = -1;
        if (__pyx_t_18 < 0) {
          __pyx_t_18 += __pyx_pybuffernd_bins.diminfo[0].shape;
          if (unlikely(__pyx_t_18 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_6 = 0;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_14 = __pyx_t_15;
        __pyx_L20_bool_binop_done:;
        if (!__pyx_t_14) break;

        /* "pandas/src/generated.pyx":7490
 *         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":7492
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_19 = __pyx_v_b;
      __pyx_t_6 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_pybuffernd_counts.diminfo[0].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_19 >= __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[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":7493
 * 
 *             counts[b] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_26 = __pyx_v_i;
      __pyx_t_27 = 0;
      __pyx_t_6 = -1;
      if (__pyx_t_26 < 0) {
        __pyx_t_26 += __pyx_pybuffernd_values.diminfo[0].shape;
        if (unlikely(__pyx_t_26 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_6 = 0;
      if (__pyx_t_27 < 0) {
        __pyx_t_27 += __pyx_pybuffernd_values.diminfo[1].shape;
        if (unlikely(__pyx_t_27 < 0)) __pyx_t_6 = 1;
      } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_6 = 1;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __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_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":7496
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 */
      __pyx_t_14 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_14) {

        /* "pandas/src/generated.pyx":7497
 *             # not nan
 *             if val == val:
 *                 nobs[b, 0] += 1             # <<<<<<<<<<<<<<
 *                 sumx[b, 0] += val
 * 
 */
        __pyx_t_28 = __pyx_v_b;
        __pyx_t_29 = 0;
        __pyx_t_6 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_28 += __pyx_pybuffernd_nobs.diminfo[0].shape;
          if (unlikely(__pyx_t_28 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_29 < 0) {
          __pyx_t_29 += __pyx_pybuffernd_nobs.diminfo[1].shape;
          if (unlikely(__pyx_t_29 < 0)) __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__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":7498
 *             if val == val:
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_30 = __pyx_v_b;
        __pyx_t_31 = 0;
        __pyx_t_6 = -1;
        if (__pyx_t_30 < 0) {
          __pyx_t_30 += __pyx_pybuffernd_sumx.diminfo[0].shape;
          if (unlikely(__pyx_t_30 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_31 < 0) {
          __pyx_t_31 += __pyx_pybuffernd_sumx.diminfo[1].shape;
          if (unlikely(__pyx_t_31 < 0)) __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__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;
        goto __pyx_L22;
      }
      __pyx_L22:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":7500
 *                 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":7501
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             count = nobs[i, j]
 *             if count == 0:
 */
    __pyx_t_32 = __pyx_v_K;
    for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) {
      __pyx_v_j = __pyx_t_33;

      /* "pandas/src/generated.pyx":7502
 *     for i in range(ngroups):
 *         for j in range(K):
 *             count = nobs[i, j]             # <<<<<<<<<<<<<<
 *             if count == 0:
 *                 out[i, j] = nan
 */
      __pyx_t_34 = __pyx_v_i;
      __pyx_t_35 = __pyx_v_j;
      __pyx_t_6 = -1;
      if (__pyx_t_34 < 0) {
        __pyx_t_34 += __pyx_pybuffernd_nobs.diminfo[0].shape;
        if (unlikely(__pyx_t_34 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_6 = 0;
      if (__pyx_t_35 < 0) {
        __pyx_t_35 += __pyx_pybuffernd_nobs.diminfo[1].shape;
        if (unlikely(__pyx_t_35 < 0)) __pyx_t_6 = 1;
      } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_6 = 1;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7502; __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_34, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[1].strides));

      /* "pandas/src/generated.pyx":7503
 *         for j in range(K):
 *             count = nobs[i, j]
 *             if count == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_14 = ((__pyx_v_count == 0.0) != 0);
      if (__pyx_t_14) {

        /* "pandas/src/generated.pyx":7504
 *             count = nobs[i, j]
 *             if count == 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_t_6 = -1;
        if (__pyx_t_36 < 0) {
          __pyx_t_36 += __pyx_pybuffernd_out.diminfo[0].shape;
          if (unlikely(__pyx_t_36 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_37 < 0) {
          __pyx_t_37 += __pyx_pybuffernd_out.diminfo[1].shape;
          if (unlikely(__pyx_t_37 < 0)) __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__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_L27;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7506
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = sumx[i, j] / count             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_38 = __pyx_v_i;
        __pyx_t_39 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_38 < 0) {
          __pyx_t_38 += __pyx_pybuffernd_sumx.diminfo[0].shape;
          if (unlikely(__pyx_t_38 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_39 < 0) {
          __pyx_t_39 += __pyx_pybuffernd_sumx.diminfo[1].shape;
          if (unlikely(__pyx_t_39 < 0)) __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __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 = 7506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_41 = __pyx_v_i;
        __pyx_t_42 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_41 < 0) {
          __pyx_t_41 += __pyx_pybuffernd_out.diminfo[0].shape;
          if (unlikely(__pyx_t_41 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_42 < 0) {
          __pyx_t_42 += __pyx_pybuffernd_out.diminfo[1].shape;
          if (unlikely(__pyx_t_42 < 0)) __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__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_L27:;
    }
  }

  /* "pandas/src/generated.pyx":7455
 *                 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_4);
  { 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":7510
 * @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_421group_ohlc_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_420group_ohlc_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_421group_ohlc_float64 = {"group_ohlc_float64", (PyCFunction)__pyx_pw_6pandas_5algos_421group_ohlc_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_420group_ohlc_float64};
static PyObject *__pyx_pw_6pandas_5algos_421group_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 = 7510; __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 = 7510; __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 = 7510; __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 = 7510; __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 = 7510; __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 = 7510; __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 = 7511; __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 = 7512; __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 = 7513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_420group_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_420group_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;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  long __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  long __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  long __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  long __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  long __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  long __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  long __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  long __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  long __pyx_t_31;
  long __pyx_t_32;
  long __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  long __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  long __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  long __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  long __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  long __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  long __pyx_t_45;
  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 = 7510; __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 = 7510; __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 = 7510; __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 = 7510; __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":7521
 *         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":7523
 *         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 = 7523; __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 = 7523; __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":7524
 * 
 *     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 = 7524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_3;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7526
 *         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 = 7526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_3 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":7528
 *         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 = 7528; __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 = 7528; __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 = 7528; __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 = 7528; __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 = 7528; __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 = 7528; __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 = 7528; __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 = 7528; __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 = 7528; __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":7530
 *     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":7531
 * 
 *     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__266, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7531; __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 = 7531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":7533
 *         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 = 7533; __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 = 7533; __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 = 7533; __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":7535
 *     NA = np.nan
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         raise NotImplementedError("Argument 'values' must have only "
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":7536
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Argument 'values' must have only "
 *                                   "one dimension")
 */
  __pyx_t_4 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":7537
 *     b = 0
 *     if K > 1:
 *         raise NotImplementedError("Argument 'values' must have only "             # <<<<<<<<<<<<<<
 *                                   "one dimension")
 *     else:
 */
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__267, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7540
 *                                   "one dimension")
 *     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":7541
 *     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_11 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
        if (__pyx_t_11) {
        } else {
          __pyx_t_4 = __pyx_t_11;
          goto __pyx_L12_bool_binop_done;
        }
        __pyx_t_12 = __pyx_v_b;
        __pyx_t_11 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_4 = __pyx_t_11;
        __pyx_L12_bool_binop_done:;
        if (!__pyx_t_4) break;

        /* "pandas/src/generated.pyx":7542
 *         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_4 = ((!(__pyx_v_got_first != 0)) != 0);
        if (__pyx_t_4) {

          /* "pandas/src/generated.pyx":7543
 *             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_13 = __pyx_v_b;
          __pyx_t_14 = 0;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

          /* "pandas/src/generated.pyx":7544
 *                 if not got_first:
 *                     out[b, 0] = NA
 *                     out[b, 1] = NA             # <<<<<<<<<<<<<<
 *                     out[b, 2] = NA
 *                     out[b, 3] = NA
 */
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_16 = 1;
          *__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_v_NA;

          /* "pandas/src/generated.pyx":7545
 *                     out[b, 0] = NA
 *                     out[b, 1] = NA
 *                     out[b, 2] = NA             # <<<<<<<<<<<<<<
 *                     out[b, 3] = NA
 *                 else:
 */
          __pyx_t_17 = __pyx_v_b;
          __pyx_t_18 = 2;
          *__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_v_NA;

          /* "pandas/src/generated.pyx":7546
 *                     out[b, 1] = NA
 *                     out[b, 2] = NA
 *                     out[b, 3] = NA             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[b, 0] = vopen
 */
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_20 = 3;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;
          goto __pyx_L14;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7548
 *                     out[b, 3] = NA
 *                 else:
 *                     out[b, 0] = vopen             # <<<<<<<<<<<<<<
 *                     out[b, 1] = vhigh
 *                     out[b, 2] = vlow
 */
          __pyx_t_21 = __pyx_v_b;
          __pyx_t_22 = 0;
          *__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_v_vopen;

          /* "pandas/src/generated.pyx":7549
 *                 else:
 *                     out[b, 0] = vopen
 *                     out[b, 1] = vhigh             # <<<<<<<<<<<<<<
 *                     out[b, 2] = vlow
 *                     out[b, 3] = vclose
 */
          __pyx_t_23 = __pyx_v_b;
          __pyx_t_24 = 1;
          *__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_v_vhigh;

          /* "pandas/src/generated.pyx":7550
 *                     out[b, 0] = vopen
 *                     out[b, 1] = vhigh
 *                     out[b, 2] = vlow             # <<<<<<<<<<<<<<
 *                     out[b, 3] = vclose
 *                 b += 1
 */
          __pyx_t_25 = __pyx_v_b;
          __pyx_t_26 = 2;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vlow;

          /* "pandas/src/generated.pyx":7551
 *                     out[b, 1] = vhigh
 *                     out[b, 2] = vlow
 *                     out[b, 3] = vclose             # <<<<<<<<<<<<<<
 *                 b += 1
 *                 got_first = 0
 */
          __pyx_t_27 = __pyx_v_b;
          __pyx_t_28 = 3;
          *__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_v_vclose;
        }
        __pyx_L14:;

        /* "pandas/src/generated.pyx":7552
 *                     out[b, 2] = vlow
 *                     out[b, 3] = vclose
 *                 b += 1             # <<<<<<<<<<<<<<
 *                 got_first = 0
 * 
 */
        __pyx_v_b = (__pyx_v_b + 1);

        /* "pandas/src/generated.pyx":7553
 *                     out[b, 3] = vclose
 *                 b += 1
 *                 got_first = 0             # <<<<<<<<<<<<<<
 * 
 *             counts[b] += 1
 */
        __pyx_v_got_first = 0;
      }

      /* "pandas/src/generated.pyx":7555
 *                 got_first = 0
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_29 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":7556
 * 
 *             counts[b] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_30 = __pyx_v_i;
      __pyx_t_31 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":7559
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 if not got_first:
 *                     got_first = 1
 */
      __pyx_t_4 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":7560
 *             # not nan
 *             if val == val:
 *                 if not got_first:             # <<<<<<<<<<<<<<
 *                     got_first = 1
 *                     vopen = val
 */
        __pyx_t_4 = ((!(__pyx_v_got_first != 0)) != 0);
        if (__pyx_t_4) {

          /* "pandas/src/generated.pyx":7561
 *             if val == val:
 *                 if not got_first:
 *                     got_first = 1             # <<<<<<<<<<<<<<
 *                     vopen = val
 *                     vlow = val
 */
          __pyx_v_got_first = 1;

          /* "pandas/src/generated.pyx":7562
 *                 if not got_first:
 *                     got_first = 1
 *                     vopen = val             # <<<<<<<<<<<<<<
 *                     vlow = val
 *                     vhigh = val
 */
          __pyx_v_vopen = __pyx_v_val;

          /* "pandas/src/generated.pyx":7563
 *                     got_first = 1
 *                     vopen = val
 *                     vlow = val             # <<<<<<<<<<<<<<
 *                     vhigh = val
 *                 else:
 */
          __pyx_v_vlow = __pyx_v_val;

          /* "pandas/src/generated.pyx":7564
 *                     vopen = val
 *                     vlow = val
 *                     vhigh = val             # <<<<<<<<<<<<<<
 *                 else:
 *                     if val < vlow:
 */
          __pyx_v_vhigh = __pyx_v_val;
          goto __pyx_L16;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7566
 *                     vhigh = val
 *                 else:
 *                     if val < vlow:             # <<<<<<<<<<<<<<
 *                         vlow = val
 *                     if val > vhigh:
 */
          __pyx_t_4 = ((__pyx_v_val < __pyx_v_vlow) != 0);
          if (__pyx_t_4) {

            /* "pandas/src/generated.pyx":7567
 *                 else:
 *                     if val < vlow:
 *                         vlow = val             # <<<<<<<<<<<<<<
 *                     if val > vhigh:
 *                         vhigh = val
 */
            __pyx_v_vlow = __pyx_v_val;
            goto __pyx_L17;
          }
          __pyx_L17:;

          /* "pandas/src/generated.pyx":7568
 *                     if val < vlow:
 *                         vlow = val
 *                     if val > vhigh:             # <<<<<<<<<<<<<<
 *                         vhigh = val
 *                 vclose = val
 */
          __pyx_t_4 = ((__pyx_v_val > __pyx_v_vhigh) != 0);
          if (__pyx_t_4) {

            /* "pandas/src/generated.pyx":7569
 *                         vlow = val
 *                     if val > vhigh:
 *                         vhigh = val             # <<<<<<<<<<<<<<
 *                 vclose = val
 * 
 */
            __pyx_v_vhigh = __pyx_v_val;
            goto __pyx_L18;
          }
          __pyx_L18:;
        }
        __pyx_L16:;

        /* "pandas/src/generated.pyx":7570
 *                     if val > vhigh:
 *                         vhigh = val
 *                 vclose = val             # <<<<<<<<<<<<<<
 * 
 *         if not got_first:
 */
        __pyx_v_vclose = __pyx_v_val;
        goto __pyx_L15;
      }
      __pyx_L15:;
    }

    /* "pandas/src/generated.pyx":7572
 *                 vclose = val
 * 
 *         if not got_first:             # <<<<<<<<<<<<<<
 *             out[b, 0] = NA
 *             out[b, 1] = NA
 */
    __pyx_t_4 = ((!(__pyx_v_got_first != 0)) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":7573
 * 
 *         if not got_first:
 *             out[b, 0] = NA             # <<<<<<<<<<<<<<
 *             out[b, 1] = NA
 *             out[b, 2] = NA
 */
      __pyx_t_1 = __pyx_v_b;
      __pyx_t_32 = 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_32, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

      /* "pandas/src/generated.pyx":7574
 *         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_33 = 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_33, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

      /* "pandas/src/generated.pyx":7575
 *             out[b, 0] = NA
 *             out[b, 1] = NA
 *             out[b, 2] = NA             # <<<<<<<<<<<<<<
 *             out[b, 3] = NA
 *         else:
 */
      __pyx_t_34 = __pyx_v_b;
      __pyx_t_35 = 2;
      *__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_NA;

      /* "pandas/src/generated.pyx":7576
 *             out[b, 1] = NA
 *             out[b, 2] = NA
 *             out[b, 3] = NA             # <<<<<<<<<<<<<<
 *         else:
 *             out[b, 0] = vopen
 */
      __pyx_t_36 = __pyx_v_b;
      __pyx_t_37 = 3;
      *__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_NA;
      goto __pyx_L19;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":7578
 *             out[b, 3] = NA
 *         else:
 *             out[b, 0] = vopen             # <<<<<<<<<<<<<<
 *             out[b, 1] = vhigh
 *             out[b, 2] = vlow
 */
      __pyx_t_38 = __pyx_v_b;
      __pyx_t_39 = 0;
      *__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_vopen;

      /* "pandas/src/generated.pyx":7579
 *         else:
 *             out[b, 0] = vopen
 *             out[b, 1] = vhigh             # <<<<<<<<<<<<<<
 *             out[b, 2] = vlow
 *             out[b, 3] = vclose
 */
      __pyx_t_40 = __pyx_v_b;
      __pyx_t_41 = 1;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vhigh;

      /* "pandas/src/generated.pyx":7580
 *             out[b, 0] = vopen
 *             out[b, 1] = vhigh
 *             out[b, 2] = vlow             # <<<<<<<<<<<<<<
 *             out[b, 3] = vclose
 * @cython.wraparound(False)
 */
      __pyx_t_42 = __pyx_v_b;
      __pyx_t_43 = 2;
      *__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_v_vlow;

      /* "pandas/src/generated.pyx":7581
 *             out[b, 1] = vhigh
 *             out[b, 2] = vlow
 *             out[b, 3] = vclose             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
      __pyx_t_44 = __pyx_v_b;
      __pyx_t_45 = 3;
      *__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_v_vclose;
    }
    __pyx_L19:;
  }

  /* "pandas/src/generated.pyx":7510
 * @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":7584
 * @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_423group_ohlc_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_422group_ohlc_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_423group_ohlc_float32 = {"group_ohlc_float32", (PyCFunction)__pyx_pw_6pandas_5algos_423group_ohlc_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_422group_ohlc_float32};
static PyObject *__pyx_pw_6pandas_5algos_423group_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 = 7584; __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 = 7584; __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 = 7584; __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 = 7584; __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 = 7584; __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 = 7584; __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 = 7585; __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 = 7586; __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 = 7587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_422group_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_422group_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;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  long __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  long __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  long __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  long __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  long __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  long __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  long __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  long __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  long __pyx_t_31;
  long __pyx_t_32;
  long __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  long __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  long __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  long __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  long __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  long __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  long __pyx_t_45;
  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 = 7584; __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 = 7584; __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 = 7584; __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 = 7584; __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":7595
 *         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":7597
 *         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 = 7597; __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 = 7597; __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":7598
 * 
 *     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 = 7598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_3;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7600
 *         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 = 7600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_3 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":7602
 *         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 = 7602; __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 = 7602; __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 = 7602; __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 = 7602; __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 = 7602; __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 = 7602; __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 = 7602; __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 = 7602; __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 = 7602; __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":7604
 *     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":7605
 * 
 *     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__268, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7605; __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 = 7605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":7607
 *         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 = 7607; __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 = 7607; __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 = 7607; __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":7609
 *     NA = np.nan
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         raise NotImplementedError("Argument 'values' must have only "
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":7610
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Argument 'values' must have only "
 *                                   "one dimension")
 */
  __pyx_t_4 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_4) {

    /* "pandas/src/generated.pyx":7611
 *     b = 0
 *     if K > 1:
 *         raise NotImplementedError("Argument 'values' must have only "             # <<<<<<<<<<<<<<
 *                                   "one dimension")
 *     else:
 */
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__269, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7614
 *                                   "one dimension")
 *     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":7615
 *     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_11 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
        if (__pyx_t_11) {
        } else {
          __pyx_t_4 = __pyx_t_11;
          goto __pyx_L12_bool_binop_done;
        }
        __pyx_t_12 = __pyx_v_b;
        __pyx_t_11 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_4 = __pyx_t_11;
        __pyx_L12_bool_binop_done:;
        if (!__pyx_t_4) break;

        /* "pandas/src/generated.pyx":7616
 *         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_4 = ((!(__pyx_v_got_first != 0)) != 0);
        if (__pyx_t_4) {

          /* "pandas/src/generated.pyx":7617
 *             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_13 = __pyx_v_b;
          __pyx_t_14 = 0;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

          /* "pandas/src/generated.pyx":7618
 *                 if not got_first:
 *                     out[b, 0] = NA
 *                     out[b, 1] = NA             # <<<<<<<<<<<<<<
 *                     out[b, 2] = NA
 *                     out[b, 3] = NA
 */
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_16 = 1;
          *__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_v_NA;

          /* "pandas/src/generated.pyx":7619
 *                     out[b, 0] = NA
 *                     out[b, 1] = NA
 *                     out[b, 2] = NA             # <<<<<<<<<<<<<<
 *                     out[b, 3] = NA
 *                 else:
 */
          __pyx_t_17 = __pyx_v_b;
          __pyx_t_18 = 2;
          *__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_v_NA;

          /* "pandas/src/generated.pyx":7620
 *                     out[b, 1] = NA
 *                     out[b, 2] = NA
 *                     out[b, 3] = NA             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[b, 0] = vopen
 */
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_20 = 3;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;
          goto __pyx_L14;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7622
 *                     out[b, 3] = NA
 *                 else:
 *                     out[b, 0] = vopen             # <<<<<<<<<<<<<<
 *                     out[b, 1] = vhigh
 *                     out[b, 2] = vlow
 */
          __pyx_t_21 = __pyx_v_b;
          __pyx_t_22 = 0;
          *__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_v_vopen;

          /* "pandas/src/generated.pyx":7623
 *                 else:
 *                     out[b, 0] = vopen
 *                     out[b, 1] = vhigh             # <<<<<<<<<<<<<<
 *                     out[b, 2] = vlow
 *                     out[b, 3] = vclose
 */
          __pyx_t_23 = __pyx_v_b;
          __pyx_t_24 = 1;
          *__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_v_vhigh;

          /* "pandas/src/generated.pyx":7624
 *                     out[b, 0] = vopen
 *                     out[b, 1] = vhigh
 *                     out[b, 2] = vlow             # <<<<<<<<<<<<<<
 *                     out[b, 3] = vclose
 *                 b += 1
 */
          __pyx_t_25 = __pyx_v_b;
          __pyx_t_26 = 2;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vlow;

          /* "pandas/src/generated.pyx":7625
 *                     out[b, 1] = vhigh
 *                     out[b, 2] = vlow
 *                     out[b, 3] = vclose             # <<<<<<<<<<<<<<
 *                 b += 1
 *                 got_first = 0
 */
          __pyx_t_27 = __pyx_v_b;
          __pyx_t_28 = 3;
          *__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_v_vclose;
        }
        __pyx_L14:;

        /* "pandas/src/generated.pyx":7626
 *                     out[b, 2] = vlow
 *                     out[b, 3] = vclose
 *                 b += 1             # <<<<<<<<<<<<<<
 *                 got_first = 0
 * 
 */
        __pyx_v_b = (__pyx_v_b + 1);

        /* "pandas/src/generated.pyx":7627
 *                     out[b, 3] = vclose
 *                 b += 1
 *                 got_first = 0             # <<<<<<<<<<<<<<
 * 
 *             counts[b] += 1
 */
        __pyx_v_got_first = 0;
      }

      /* "pandas/src/generated.pyx":7629
 *                 got_first = 0
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_29 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":7630
 * 
 *             counts[b] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_30 = __pyx_v_i;
      __pyx_t_31 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":7633
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 if not got_first:
 *                     got_first = 1
 */
      __pyx_t_4 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_4) {

        /* "pandas/src/generated.pyx":7634
 *             # not nan
 *             if val == val:
 *                 if not got_first:             # <<<<<<<<<<<<<<
 *                     got_first = 1
 *                     vopen = val
 */
        __pyx_t_4 = ((!(__pyx_v_got_first != 0)) != 0);
        if (__pyx_t_4) {

          /* "pandas/src/generated.pyx":7635
 *             if val == val:
 *                 if not got_first:
 *                     got_first = 1             # <<<<<<<<<<<<<<
 *                     vopen = val
 *                     vlow = val
 */
          __pyx_v_got_first = 1;

          /* "pandas/src/generated.pyx":7636
 *                 if not got_first:
 *                     got_first = 1
 *                     vopen = val             # <<<<<<<<<<<<<<
 *                     vlow = val
 *                     vhigh = val
 */
          __pyx_v_vopen = __pyx_v_val;

          /* "pandas/src/generated.pyx":7637
 *                     got_first = 1
 *                     vopen = val
 *                     vlow = val             # <<<<<<<<<<<<<<
 *                     vhigh = val
 *                 else:
 */
          __pyx_v_vlow = __pyx_v_val;

          /* "pandas/src/generated.pyx":7638
 *                     vopen = val
 *                     vlow = val
 *                     vhigh = val             # <<<<<<<<<<<<<<
 *                 else:
 *                     if val < vlow:
 */
          __pyx_v_vhigh = __pyx_v_val;
          goto __pyx_L16;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":7640
 *                     vhigh = val
 *                 else:
 *                     if val < vlow:             # <<<<<<<<<<<<<<
 *                         vlow = val
 *                     if val > vhigh:
 */
          __pyx_t_4 = ((__pyx_v_val < __pyx_v_vlow) != 0);
          if (__pyx_t_4) {

            /* "pandas/src/generated.pyx":7641
 *                 else:
 *                     if val < vlow:
 *                         vlow = val             # <<<<<<<<<<<<<<
 *                     if val > vhigh:
 *                         vhigh = val
 */
            __pyx_v_vlow = __pyx_v_val;
            goto __pyx_L17;
          }
          __pyx_L17:;

          /* "pandas/src/generated.pyx":7642
 *                     if val < vlow:
 *                         vlow = val
 *                     if val > vhigh:             # <<<<<<<<<<<<<<
 *                         vhigh = val
 *                 vclose = val
 */
          __pyx_t_4 = ((__pyx_v_val > __pyx_v_vhigh) != 0);
          if (__pyx_t_4) {

            /* "pandas/src/generated.pyx":7643
 *                         vlow = val
 *                     if val > vhigh:
 *                         vhigh = val             # <<<<<<<<<<<<<<
 *                 vclose = val
 * 
 */
            __pyx_v_vhigh = __pyx_v_val;
            goto __pyx_L18;
          }
          __pyx_L18:;
        }
        __pyx_L16:;

        /* "pandas/src/generated.pyx":7644
 *                     if val > vhigh:
 *                         vhigh = val
 *                 vclose = val             # <<<<<<<<<<<<<<
 * 
 *         if not got_first:
 */
        __pyx_v_vclose = __pyx_v_val;
        goto __pyx_L15;
      }
      __pyx_L15:;
    }

    /* "pandas/src/generated.pyx":7646
 *                 vclose = val
 * 
 *         if not got_first:             # <<<<<<<<<<<<<<
 *             out[b, 0] = NA
 *             out[b, 1] = NA
 */
    __pyx_t_4 = ((!(__pyx_v_got_first != 0)) != 0);
    if (__pyx_t_4) {

      /* "pandas/src/generated.pyx":7647
 * 
 *         if not got_first:
 *             out[b, 0] = NA             # <<<<<<<<<<<<<<
 *             out[b, 1] = NA
 *             out[b, 2] = NA
 */
      __pyx_t_1 = __pyx_v_b;
      __pyx_t_32 = 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_32, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

      /* "pandas/src/generated.pyx":7648
 *         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_33 = 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_33, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA;

      /* "pandas/src/generated.pyx":7649
 *             out[b, 0] = NA
 *             out[b, 1] = NA
 *             out[b, 2] = NA             # <<<<<<<<<<<<<<
 *             out[b, 3] = NA
 *         else:
 */
      __pyx_t_34 = __pyx_v_b;
      __pyx_t_35 = 2;
      *__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_NA;

      /* "pandas/src/generated.pyx":7650
 *             out[b, 1] = NA
 *             out[b, 2] = NA
 *             out[b, 3] = NA             # <<<<<<<<<<<<<<
 *         else:
 *             out[b, 0] = vopen
 */
      __pyx_t_36 = __pyx_v_b;
      __pyx_t_37 = 3;
      *__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_NA;
      goto __pyx_L19;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":7652
 *             out[b, 3] = NA
 *         else:
 *             out[b, 0] = vopen             # <<<<<<<<<<<<<<
 *             out[b, 1] = vhigh
 *             out[b, 2] = vlow
 */
      __pyx_t_38 = __pyx_v_b;
      __pyx_t_39 = 0;
      *__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_vopen;

      /* "pandas/src/generated.pyx":7653
 *         else:
 *             out[b, 0] = vopen
 *             out[b, 1] = vhigh             # <<<<<<<<<<<<<<
 *             out[b, 2] = vlow
 *             out[b, 3] = vclose
 */
      __pyx_t_40 = __pyx_v_b;
      __pyx_t_41 = 1;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vhigh;

      /* "pandas/src/generated.pyx":7654
 *             out[b, 0] = vopen
 *             out[b, 1] = vhigh
 *             out[b, 2] = vlow             # <<<<<<<<<<<<<<
 *             out[b, 3] = vclose
 * 
 */
      __pyx_t_42 = __pyx_v_b;
      __pyx_t_43 = 2;
      *__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_v_vlow;

      /* "pandas/src/generated.pyx":7655
 *             out[b, 1] = vhigh
 *             out[b, 2] = vlow
 *             out[b, 3] = vclose             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
      __pyx_t_44 = __pyx_v_b;
      __pyx_t_45 = 3;
      *__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_v_vclose;
    }
    __pyx_L19:;
  }

  /* "pandas/src/generated.pyx":7584
 * @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":7659
 * @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_425group_last_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_424group_last_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_425group_last_float64 = {"group_last_float64", (PyCFunction)__pyx_pw_6pandas_5algos_425group_last_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_424group_last_float64};
static PyObject *__pyx_pw_6pandas_5algos_425group_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 = 7659; __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 = 7659; __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 = 7659; __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 = 7659; __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 = 7659; __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 = 7659; __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 = 7660; __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 = 7661; __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 = 7662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_424group_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_424group_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 = 7659; __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 = 7659; __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 = 7659; __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 = 7659; __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":7672
 *         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 = 7672; __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 = 7672; __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":7673
 * 
 *     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__270, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7673; __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 = 7673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":7675
 *        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 = 7675; __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 = 7675; __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 = 7675; __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 = 7675; __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 = 7675; __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 = 7675; __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 = 7675; __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 = 7675; __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 = 7675; __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 = 7675; __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 = 7675; __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":7676
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7676; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7676; __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;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_8);
  {
    __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 = 7676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pandas/src/generated.pyx":7678
 *     resx = np.empty_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
    PyObject* sequence = __pyx_t_8;
    #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 = 7678; __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 = 7678; __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 = 7678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_15 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_5 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_15 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7678; __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 = 7678; __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 = 7678; __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":7680
 *     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":7681
 * 
 *     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 = 7681; __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":7682
 *     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":7683
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L6_continue;
    }

    /* "pandas/src/generated.pyx":7685
 *             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 = 7685; __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":7686
 * 
 *         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":7687
 *         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 = 7687; __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":7690
 * 
 *             # 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":7691
 *             # 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 = 7691; __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":7692
 *             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 = 7692; __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":7694
 *                 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 = 7694; __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":7695
 * 
 *     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":7696
 *     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 = 7696; __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":7697
 *         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 = 7697; __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":7699
 *                 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 = 7699; __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 = 7699; __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":7659
 * @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":7702
 * @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_427group_last_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_426group_last_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_427group_last_float32 = {"group_last_float32", (PyCFunction)__pyx_pw_6pandas_5algos_427group_last_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_426group_last_float32};
static PyObject *__pyx_pw_6pandas_5algos_427group_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 = 7702; __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 = 7702; __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 = 7702; __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 = 7702; __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 = 7702; __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 = 7702; __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 = 7703; __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 = 7704; __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 = 7705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_426group_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_426group_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 = 7702; __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 = 7702; __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 = 7702; __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 = 7702; __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":7715
 *         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 = 7715; __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 = 7715; __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":7716
 * 
 *     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__271, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7716; __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 = 7716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":7718
 *        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 = 7718; __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 = 7718; __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 = 7718; __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 = 7718; __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 = 7718; __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 = 7718; __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 = 7718; __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 = 7718; __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 = 7718; __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 = 7718; __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 = 7718; __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":7719
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7719; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7719; __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;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_8);
  {
    __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 = 7719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pandas/src/generated.pyx":7721
 *     resx = np.empty_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
    PyObject* sequence = __pyx_t_8;
    #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 = 7721; __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 = 7721; __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 = 7721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_15 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_5 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_15 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7721; __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 = 7721; __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 = 7721; __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":7723
 *     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":7724
 * 
 *     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 = 7724; __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":7725
 *     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":7726
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L6_continue;
    }

    /* "pandas/src/generated.pyx":7728
 *             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 = 7728; __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":7729
 * 
 *         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":7730
 *         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 = 7730; __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":7733
 * 
 *             # 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":7734
 *             # 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 = 7734; __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":7735
 *             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 = 7735; __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":7737
 *                 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 = 7737; __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":7738
 * 
 *     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":7739
 *     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 = 7739; __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":7740
 *         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 = 7740; __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":7742
 *                 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 = 7742; __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 = 7742; __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":7702
 * @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":7745
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[int64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_429group_last_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_428group_last_int64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_429group_last_int64 = {"group_last_int64", (PyCFunction)__pyx_pw_6pandas_5algos_429group_last_int64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_428group_last_int64};
static PyObject *__pyx_pw_6pandas_5algos_429group_last_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_last_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_last_int64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7745; __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_int64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7745; __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_int64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7745; __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_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7745; __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_int64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7745; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_last_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 = 7745; __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 = 7746; __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 = 7747; __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 = 7748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_428group_last_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_428group_last_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_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_lab;
  __pyx_t_5numpy_int64_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_int64", 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_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7745; __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 = 7745; __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 = 7745; __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 = 7745; __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":7758
 *         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 = 7758; __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 = 7758; __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":7759
 * 
 *     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__272, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7759; __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 = 7759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":7761
 *        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 = 7761; __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 = 7761; __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 = 7761; __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 = 7761; __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 = 7761; __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 = 7761; __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 = 7761; __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 = 7761; __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 = 7761; __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 = 7761; __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 = 7761; __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":7762
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7762; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7762; __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;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_8);
  {
    __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_int64_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_int64_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 = 7762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pandas/src/generated.pyx":7764
 *     resx = np.empty_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
    PyObject* sequence = __pyx_t_8;
    #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 = 7764; __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 = 7764; __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 = 7764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_15 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_5 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_15 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7764; __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 = 7764; __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 = 7764; __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":7766
 *     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":7767
 * 
 *     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 = 7767; __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":7768
 *     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":7769
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L6_continue;
    }

    /* "pandas/src/generated.pyx":7771
 *             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 = 7771; __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":7772
 * 
 *         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":7773
 *         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 = 7773; __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_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":7776
 * 
 *             # 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":7777
 *             # 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 = 7777; __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":7778
 *             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 = 7778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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":7780
 *                 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 = 7780; __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":7781
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = iNaT
 */
    __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":7782
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = iNaT
 *             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 = 7782; __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":7783
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = iNaT             # <<<<<<<<<<<<<<
 *             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 = 7783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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_iNaT;
        goto __pyx_L16;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7785
 *                 out[i, j] = iNaT
 *             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 = 7785; __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 = 7785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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_int64_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":7745
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_int64(ndarray[int64_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_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_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_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":7789
 * @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_431group_last_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_430group_last_bin_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_431group_last_bin_float64 = {"group_last_bin_float64", (PyCFunction)__pyx_pw_6pandas_5algos_431group_last_bin_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_430group_last_bin_float64};
static PyObject *__pyx_pw_6pandas_5algos_431group_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 = 7789; __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 = 7789; __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 = 7789; __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 = 7789; __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 = 7789; __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 = 7789; __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 = 7790; __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 = 7791; __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 = 7792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_430group_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_430group_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  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_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 = 7789; __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 = 7789; __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 = 7789; __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 = 7789; __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":7801
 *         ndarray[float64_t, ndim=2] resx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7801; __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 = 7801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7801; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7801; __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_3); __pyx_t_3 = 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 = 7801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7802
 * 
 *     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 = 7802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7802; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7802; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7804
 *     resx = np.empty_like(out)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_10 - 1);
  __pyx_t_6 = -1;
  if (__pyx_t_11 < 0) {
    __pyx_t_6 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_6 = 0;
  if (unlikely(__pyx_t_6 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_6);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_12) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":7805
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_12;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7807
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_12 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":7809
 *         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 = 7809; __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 = 7809; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7809; __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_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_12;
  __pyx_v_K = __pyx_t_10;

  /* "pandas/src/generated.pyx":7811
 *     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":7812
 * 
 *     b = 0
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         while b < ngroups - 1 and i >= bins[b]:
 *             b += 1
 */
  __pyx_t_10 = __pyx_v_N;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":7813
 *     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) {
      } else {
        __pyx_t_13 = __pyx_t_15;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_16 = __pyx_v_b;
      __pyx_t_6 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
      __pyx_t_13 = __pyx_t_15;
      __pyx_L10_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":7814
 *     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":7816
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_17 = __pyx_v_b;
    __pyx_t_6 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_17 >= __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[2]; __pyx_lineno = 7816; __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":7817
 * 
 *         counts[b] += 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":7818
 *         counts[b] += 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_6 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_6 = 0;
      if (__pyx_t_21 < 0) {
        __pyx_t_6 = 1;
      } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_6 = 1;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7818; __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":7821
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, j] += 1
 *                 resx[b, j] = val
 */
      __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":7822
 *             # not nan
 *             if val == val:
 *                 nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                 resx[b, j] = val
 * 
 */
        __pyx_t_22 = __pyx_v_b;
        __pyx_t_23 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_22 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_23 < 0) {
          __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_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.0;

        /* "pandas/src/generated.pyx":7823
 *             if val == val:
 *                 nobs[b, j] += 1
 *                 resx[b, j] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_24 = __pyx_v_b;
        __pyx_t_25 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_24 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_25 < 0) {
          __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7823; __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_L14;
      }
      __pyx_L14:;
    }
  }

  /* "pandas/src/generated.pyx":7825
 *                 resx[b, j] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_10 = __pyx_v_ngroups;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":7826
 * 
 *     for i in range(ngroups):
 *         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":7827
 *     for i in range(ngroups):
 *         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_6 = -1;
      if (__pyx_t_26 < 0) {
        __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_6 = 0;
      if (__pyx_t_27 < 0) {
        __pyx_t_6 = 1;
      } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_6 = 1;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = (((*__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)) == 0.0) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":7828
 *         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_6 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_29 < 0) {
          __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __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_L19;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7830
 *                 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_6 = -1;
        if (__pyx_t_30 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_31 < 0) {
          __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_32 = __pyx_v_i;
        __pyx_t_33 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_32 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_33 < 0) {
          __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __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_L19:;
    }
  }

  /* "pandas/src/generated.pyx":7789
 * @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_4);
  { 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":7833
 * @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_433group_last_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_432group_last_bin_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_433group_last_bin_float32 = {"group_last_bin_float32", (PyCFunction)__pyx_pw_6pandas_5algos_433group_last_bin_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_432group_last_bin_float32};
static PyObject *__pyx_pw_6pandas_5algos_433group_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 = 7833; __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 = 7833; __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 = 7833; __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 = 7833; __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 = 7833; __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 = 7833; __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 = 7834; __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 = 7835; __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 = 7836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_432group_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_432group_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  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_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 = 7833; __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 = 7833; __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 = 7833; __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 = 7833; __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":7845
 *         ndarray[float32_t, ndim=2] resx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7845; __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 = 7845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7845; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7845; __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_3); __pyx_t_3 = 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 = 7845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7846
 * 
 *     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 = 7846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7846; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7846; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7848
 *     resx = np.empty_like(out)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_10 - 1);
  __pyx_t_6 = -1;
  if (__pyx_t_11 < 0) {
    __pyx_t_6 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_6 = 0;
  if (unlikely(__pyx_t_6 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_6);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_12) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":7849
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_12;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7851
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_12 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":7853
 *         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 = 7853; __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 = 7853; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7853; __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_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_12;
  __pyx_v_K = __pyx_t_10;

  /* "pandas/src/generated.pyx":7855
 *     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":7856
 * 
 *     b = 0
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         while b < ngroups - 1 and i >= bins[b]:
 *             b += 1
 */
  __pyx_t_10 = __pyx_v_N;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":7857
 *     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) {
      } else {
        __pyx_t_13 = __pyx_t_15;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_16 = __pyx_v_b;
      __pyx_t_6 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
      __pyx_t_13 = __pyx_t_15;
      __pyx_L10_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":7858
 *     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":7860
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_17 = __pyx_v_b;
    __pyx_t_6 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_17 >= __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[2]; __pyx_lineno = 7860; __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":7861
 * 
 *         counts[b] += 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":7862
 *         counts[b] += 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_6 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_6 = 0;
      if (__pyx_t_21 < 0) {
        __pyx_t_6 = 1;
      } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_6 = 1;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7862; __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":7865
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, j] += 1
 *                 resx[b, j] = val
 */
      __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":7866
 *             # not nan
 *             if val == val:
 *                 nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                 resx[b, j] = val
 * 
 */
        __pyx_t_22 = __pyx_v_b;
        __pyx_t_23 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_22 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_23 < 0) {
          __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_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.0;

        /* "pandas/src/generated.pyx":7867
 *             if val == val:
 *                 nobs[b, j] += 1
 *                 resx[b, j] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_24 = __pyx_v_b;
        __pyx_t_25 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_24 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_25 < 0) {
          __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7867; __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_L14;
      }
      __pyx_L14:;
    }
  }

  /* "pandas/src/generated.pyx":7869
 *                 resx[b, j] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_10 = __pyx_v_ngroups;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":7870
 * 
 *     for i in range(ngroups):
 *         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":7871
 *     for i in range(ngroups):
 *         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_6 = -1;
      if (__pyx_t_26 < 0) {
        __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_6 = 0;
      if (__pyx_t_27 < 0) {
        __pyx_t_6 = 1;
      } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_6 = 1;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = (((*__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)) == 0.0) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":7872
 *         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_6 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_29 < 0) {
          __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7872; __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_L19;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7874
 *                 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_6 = -1;
        if (__pyx_t_30 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_31 < 0) {
          __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_32 = __pyx_v_i;
        __pyx_t_33 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_32 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_33 < 0) {
          __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7874; __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_L19:;
    }
  }

  /* "pandas/src/generated.pyx":7833
 * @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_4);
  { 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":7877
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[int64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_435group_last_bin_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_434group_last_bin_int64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_435group_last_bin_int64 = {"group_last_bin_int64", (PyCFunction)__pyx_pw_6pandas_5algos_435group_last_bin_int64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_434group_last_bin_int64};
static PyObject *__pyx_pw_6pandas_5algos_435group_last_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_last_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_last_bin_int64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7877; __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_int64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7877; __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_int64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7877; __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_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7877; __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_int64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7877; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_last_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 = 7877; __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 = 7878; __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 = 7879; __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 = 7880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_434group_last_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_434group_last_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_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_b;
  __pyx_t_5numpy_int64_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  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_bin_int64", 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_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7877; __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 = 7877; __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 = 7877; __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 = 7877; __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":7889
 *         ndarray[int64_t, ndim=2] resx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7889; __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 = 7889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7889; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7889; __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_3); __pyx_t_3 = 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 = 7889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7890
 * 
 *     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 = 7890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7890; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7890; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":7892
 *     resx = np.empty_like(out)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_10 - 1);
  __pyx_t_6 = -1;
  if (__pyx_t_11 < 0) {
    __pyx_t_6 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_6 = 0;
  if (unlikely(__pyx_t_6 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_6);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_12) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":7893
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_12;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":7895
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_12 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":7897
 *         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 = 7897; __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 = 7897; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7897; __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_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_12;
  __pyx_v_K = __pyx_t_10;

  /* "pandas/src/generated.pyx":7899
 *     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":7900
 * 
 *     b = 0
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         while b < ngroups - 1 and i >= bins[b]:
 *             b += 1
 */
  __pyx_t_10 = __pyx_v_N;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":7901
 *     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) {
      } else {
        __pyx_t_13 = __pyx_t_15;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_16 = __pyx_v_b;
      __pyx_t_6 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
      __pyx_t_13 = __pyx_t_15;
      __pyx_L10_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":7902
 *     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":7904
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_17 = __pyx_v_b;
    __pyx_t_6 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_17 >= __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[2]; __pyx_lineno = 7904; __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":7905
 * 
 *         counts[b] += 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":7906
 *         counts[b] += 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_6 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_6 = 0;
      if (__pyx_t_21 < 0) {
        __pyx_t_6 = 1;
      } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_6 = 1;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7906; __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_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":7909
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, j] += 1
 *                 resx[b, j] = val
 */
      __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":7910
 *             # not nan
 *             if val == val:
 *                 nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                 resx[b, j] = val
 * 
 */
        __pyx_t_22 = __pyx_v_b;
        __pyx_t_23 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_22 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_23 < 0) {
          __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7910; __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":7911
 *             if val == val:
 *                 nobs[b, j] += 1
 *                 resx[b, j] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_24 = __pyx_v_b;
        __pyx_t_25 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_24 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_25 < 0) {
          __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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_L14;
      }
      __pyx_L14:;
    }
  }

  /* "pandas/src/generated.pyx":7913
 *                 resx[b, j] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_10 = __pyx_v_ngroups;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":7914
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = iNaT
 */
    __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":7915
 *     for i in range(ngroups):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = iNaT
 *             else:
 */
      __pyx_t_26 = __pyx_v_i;
      __pyx_t_27 = __pyx_v_j;
      __pyx_t_6 = -1;
      if (__pyx_t_26 < 0) {
        __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_6 = 0;
      if (__pyx_t_27 < 0) {
        __pyx_t_6 = 1;
      } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_6 = 1;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = (((*__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_13) {

        /* "pandas/src/generated.pyx":7916
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = iNaT             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = resx[i, j]
 */
        __pyx_t_28 = __pyx_v_i;
        __pyx_t_29 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_29 < 0) {
          __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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_iNaT;
        goto __pyx_L19;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":7918
 *                 out[i, j] = iNaT
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
        __pyx_t_30 = __pyx_v_i;
        __pyx_t_31 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_30 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_31 < 0) {
          __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_32 = __pyx_v_i;
        __pyx_t_33 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_32 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_6 = 0;
        if (__pyx_t_33 < 0) {
          __pyx_t_6 = 1;
        } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_6 = 1;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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_int64_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_L19:;
    }
  }

  /* "pandas/src/generated.pyx":7877
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_bin_int64(ndarray[int64_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);
  { 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_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_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":7922
 * @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_437group_nth_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_436group_nth_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_437group_nth_float64 = {"group_nth_float64", (PyCFunction)__pyx_pw_6pandas_5algos_437group_nth_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_436group_nth_float64};
static PyObject *__pyx_pw_6pandas_5algos_437group_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 = 7922; __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 = 7922; __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 = 7922; __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 = 7922; __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 = 7922; __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 = 7925; __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 = 7922; __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 = 7922; __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 = 7923; __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 = 7924; __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 = 7925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_436group_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_436group_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 = 7922; __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 = 7922; __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 = 7922; __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 = 7922; __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":7935
 *         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 = 7935; __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 = 7935; __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":7936
 * 
 *     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__273, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7936; __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 = 7936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":7938
 *        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 = 7938; __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 = 7938; __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 = 7938; __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 = 7938; __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 = 7938; __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 = 7938; __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 = 7938; __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 = 7938; __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 = 7938; __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 = 7938; __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 = 7938; __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":7939
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7939; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7939; __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;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_8);
  {
    __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 = 7939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pandas/src/generated.pyx":7941
 *     resx = np.empty_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
    PyObject* sequence = __pyx_t_8;
    #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 = 7941; __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 = 7941; __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 = 7941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_15 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_5 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_15 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7941; __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 = 7941; __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 = 7941; __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":7943
 *     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":7944
 * 
 *     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":7945
 *     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":7946
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L6_continue;
    }

    /* "pandas/src/generated.pyx":7948
 *             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":7949
 * 
 *         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":7950
 *         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":7953
 * 
 *             # 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":7954
 *             # 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":7955
 *             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":7956
 *                 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":7958
 *                     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 = 7958; __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":7959
 * 
 *     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":7960
 *     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":7961
 *         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":7963
 *                 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":7922
 * @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":7966
 * @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_439group_nth_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_438group_nth_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_439group_nth_float32 = {"group_nth_float32", (PyCFunction)__pyx_pw_6pandas_5algos_439group_nth_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_438group_nth_float32};
static PyObject *__pyx_pw_6pandas_5algos_439group_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 = 7966; __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 = 7966; __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 = 7966; __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 = 7966; __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 = 7966; __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 = 7969; __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 = 7966; __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 = 7966; __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 = 7967; __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 = 7968; __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 = 7969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_438group_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_438group_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 = 7966; __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 = 7966; __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 = 7966; __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 = 7966; __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":7979
 *         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 = 7979; __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 = 7979; __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":7980
 * 
 *     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__274, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7980; __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 = 7980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":7982
 *        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 = 7982; __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 = 7982; __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 = 7982; __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 = 7982; __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 = 7982; __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 = 7982; __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 = 7982; __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 = 7982; __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 = 7982; __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 = 7982; __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 = 7982; __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":7983
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7983; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7983; __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;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_8);
  {
    __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 = 7983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pandas/src/generated.pyx":7985
 *     resx = np.empty_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
    PyObject* sequence = __pyx_t_8;
    #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 = 7985; __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 = 7985; __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 = 7985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_15 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_5 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_15 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7985; __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 = 7985; __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 = 7985; __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":7987
 *     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":7988
 * 
 *     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":7989
 *     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":7990
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L6_continue;
    }

    /* "pandas/src/generated.pyx":7992
 *             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":7993
 * 
 *         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":7994
 *         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":7997
 * 
 *             # 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":7998
 *             # 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":7999
 *             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":8000
 *                 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":8002
 *                     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 = 8002; __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":8003
 * 
 *     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":8004
 *     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":8005
 *         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":8007
 *                 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_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":7966
 * @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":8010
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[int64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_441group_nth_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_440group_nth_int64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_441group_nth_int64 = {"group_nth_int64", (PyCFunction)__pyx_pw_6pandas_5algos_441group_nth_int64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_440group_nth_int64};
static PyObject *__pyx_pw_6pandas_5algos_441group_nth_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;
  __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_int64 (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_int64", 1, 5, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8010; __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_int64", 1, 5, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8010; __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_int64", 1, 5, 5, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8010; __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_int64", 1, 5, 5, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8010; __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_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8010; __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 = 8013; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_nth_int64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8010; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_nth_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 = 8010; __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 = 8011; __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 = 8012; __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 = 8013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_440group_nth_int64(__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_440group_nth_int64(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_int64_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_int64", 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_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8010; __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 = 8010; __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 = 8010; __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 = 8010; __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":8023
 *         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 = 8023; __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 = 8023; __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":8024
 * 
 *     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__275, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8024; __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 = 8024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":8026
 *        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 = 8026; __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 = 8026; __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 = 8026; __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 = 8026; __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 = 8026; __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 = 8026; __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 = 8026; __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 = 8026; __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 = 8026; __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 = 8026; __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 = 8026; __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":8027
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8027; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8027; __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;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_8);
  {
    __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_int64_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_int64_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 = 8027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pandas/src/generated.pyx":8029
 *     resx = np.empty_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
    PyObject* sequence = __pyx_t_8;
    #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 = 8029; __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 = 8029; __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 = 8029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_15 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_5 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_15 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8029; __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 = 8029; __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 = 8029; __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":8031
 *     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":8032
 * 
 *     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":8033
 *     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":8034
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L6_continue;
    }

    /* "pandas/src/generated.pyx":8036
 *             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":8037
 * 
 *         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":8038
 *         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_int64_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":8041
 * 
 *             # 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":8042
 *             # 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":8043
 *             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":8044
 *                 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_int64_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":8046
 *                     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 = 8046; __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":8047
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = iNaT
 */
    __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":8048
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = iNaT
 *             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":8049
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = iNaT             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = resx[i, j]
 */
        __pyx_t_30 = __pyx_v_i;
        __pyx_t_31 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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_iNaT;
        goto __pyx_L17;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8051
 *                 out[i, j] = iNaT
 *             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_int64_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_int64_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":8010
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_int64(ndarray[int64_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_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_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_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":8055
 * @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_443group_nth_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_442group_nth_bin_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_443group_nth_bin_float64 = {"group_nth_bin_float64", (PyCFunction)__pyx_pw_6pandas_5algos_443group_nth_bin_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_442group_nth_bin_float64};
static PyObject *__pyx_pw_6pandas_5algos_443group_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 = 8055; __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 = 8055; __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 = 8055; __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 = 8055; __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 = 8055; __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 = 8058; __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 = 8055; __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 = 8055; __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 = 8056; __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 = 8057; __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 = 8058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_442group_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_442group_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  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_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 = 8055; __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 = 8055; __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 = 8055; __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 = 8055; __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":8067
 *         ndarray[float64_t, ndim=2] resx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8067; __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 = 8067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8067; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8067; __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_3); __pyx_t_3 = 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 = 8067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8068
 * 
 *     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 = 8068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8068; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8068; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8070
 *     resx = np.empty_like(out)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_10 - 1);
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_12) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":8071
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_12;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8073
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_12 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":8075
 *         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 = 8075; __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 = 8075; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8075; __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_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_12;
  __pyx_v_K = __pyx_t_10;

  /* "pandas/src/generated.pyx":8077
 *     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":8078
 * 
 *     b = 0
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         while b < ngroups - 1 and i >= bins[b]:
 *             b += 1
 */
  __pyx_t_10 = __pyx_v_N;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":8079
 *     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) {
      } else {
        __pyx_t_13 = __pyx_t_15;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_16 = __pyx_v_b;
      __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
      __pyx_t_13 = __pyx_t_15;
      __pyx_L10_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":8080
 *     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":8082
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_17 = __pyx_v_b;
    *__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":8083
 * 
 *         counts[b] += 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":8084
 *         counts[b] += 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":8087
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:
 */
      __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":8088
 *             # not nan
 *             if val == val:
 *                 nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                 if nobs[b, j] == rank:
 *                     resx[b, j] = val
 */
        __pyx_t_22 = __pyx_v_b;
        __pyx_t_23 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_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.0;

        /* "pandas/src/generated.pyx":8089
 *             if val == val:
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:             # <<<<<<<<<<<<<<
 *                     resx[b, j] = val
 * 
 */
        __pyx_t_24 = __pyx_v_b;
        __pyx_t_25 = __pyx_v_j;
        __pyx_t_13 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_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_13) {

          /* "pandas/src/generated.pyx":8090
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:
 *                     resx[b, j] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
          __pyx_t_26 = __pyx_v_b;
          __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_L15;
        }
        __pyx_L15:;
        goto __pyx_L14;
      }
      __pyx_L14:;
    }
  }

  /* "pandas/src/generated.pyx":8092
 *                     resx[b, j] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_10 = __pyx_v_ngroups;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":8093
 * 
 *     for i in range(ngroups):
 *         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":8094
 *     for i in range(ngroups):
 *         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_13 = (((*__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)) == 0.0) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":8095
 *         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_L20;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8097
 *                 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_L20:;
    }
  }

  /* "pandas/src/generated.pyx":8055
 * @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_4);
  { 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":8100
 * @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_445group_nth_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_444group_nth_bin_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_445group_nth_bin_float32 = {"group_nth_bin_float32", (PyCFunction)__pyx_pw_6pandas_5algos_445group_nth_bin_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_444group_nth_bin_float32};
static PyObject *__pyx_pw_6pandas_5algos_445group_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 = 8100; __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 = 8100; __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 = 8100; __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 = 8100; __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 = 8100; __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 = 8103; __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 = 8100; __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 = 8100; __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 = 8101; __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 = 8102; __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 = 8103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_444group_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_444group_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  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_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 = 8100; __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 = 8100; __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 = 8100; __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 = 8100; __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":8112
 *         ndarray[float32_t, ndim=2] resx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8112; __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 = 8112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8112; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8112; __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_3); __pyx_t_3 = 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 = 8112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8113
 * 
 *     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 = 8113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8113; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8113; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8115
 *     resx = np.empty_like(out)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_10 - 1);
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_12) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":8116
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_12;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8118
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_12 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":8120
 *         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 = 8120; __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 = 8120; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8120; __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_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_12;
  __pyx_v_K = __pyx_t_10;

  /* "pandas/src/generated.pyx":8122
 *     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":8123
 * 
 *     b = 0
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         while b < ngroups - 1 and i >= bins[b]:
 *             b += 1
 */
  __pyx_t_10 = __pyx_v_N;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":8124
 *     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) {
      } else {
        __pyx_t_13 = __pyx_t_15;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_16 = __pyx_v_b;
      __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
      __pyx_t_13 = __pyx_t_15;
      __pyx_L10_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":8125
 *     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":8127
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_17 = __pyx_v_b;
    *__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":8128
 * 
 *         counts[b] += 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":8129
 *         counts[b] += 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":8132
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:
 */
      __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":8133
 *             # not nan
 *             if val == val:
 *                 nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                 if nobs[b, j] == rank:
 *                     resx[b, j] = val
 */
        __pyx_t_22 = __pyx_v_b;
        __pyx_t_23 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_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.0;

        /* "pandas/src/generated.pyx":8134
 *             if val == val:
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:             # <<<<<<<<<<<<<<
 *                     resx[b, j] = val
 * 
 */
        __pyx_t_24 = __pyx_v_b;
        __pyx_t_25 = __pyx_v_j;
        __pyx_t_13 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_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_13) {

          /* "pandas/src/generated.pyx":8135
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:
 *                     resx[b, j] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
          __pyx_t_26 = __pyx_v_b;
          __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_L15;
        }
        __pyx_L15:;
        goto __pyx_L14;
      }
      __pyx_L14:;
    }
  }

  /* "pandas/src/generated.pyx":8137
 *                     resx[b, j] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_10 = __pyx_v_ngroups;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":8138
 * 
 *     for i in range(ngroups):
 *         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":8139
 *     for i in range(ngroups):
 *         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_13 = (((*__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)) == 0.0) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":8140
 *         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_L20;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8142
 *                 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_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_L20:;
    }
  }

  /* "pandas/src/generated.pyx":8100
 * @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_4);
  { 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":8145
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[int64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_447group_nth_bin_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_446group_nth_bin_int64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_447group_nth_bin_int64 = {"group_nth_bin_int64", (PyCFunction)__pyx_pw_6pandas_5algos_447group_nth_bin_int64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_446group_nth_bin_int64};
static PyObject *__pyx_pw_6pandas_5algos_447group_nth_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;
  __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_int64 (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_int64", 1, 5, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8145; __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_int64", 1, 5, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8145; __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_int64", 1, 5, 5, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8145; __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_int64", 1, 5, 5, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8145; __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_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8145; __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 = 8148; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_nth_bin_int64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8145; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_nth_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 = 8145; __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 = 8146; __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 = 8147; __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 = 8148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_446group_nth_bin_int64(__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_446group_nth_bin_int64(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_int64_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  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_bin_int64", 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_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8145; __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 = 8145; __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 = 8145; __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 = 8145; __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":8157
 *         ndarray[int64_t, ndim=2] resx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8157; __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 = 8157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8157; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8157; __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_3); __pyx_t_3 = 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 = 8157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8158
 * 
 *     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 = 8158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8158; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8158; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8160
 *     resx = np.empty_like(out)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_10 - 1);
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_12) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":8161
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_12;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8163
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_12 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":8165
 *         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 = 8165; __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 = 8165; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8165; __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_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_12;
  __pyx_v_K = __pyx_t_10;

  /* "pandas/src/generated.pyx":8167
 *     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":8168
 * 
 *     b = 0
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         while b < ngroups - 1 and i >= bins[b]:
 *             b += 1
 */
  __pyx_t_10 = __pyx_v_N;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":8169
 *     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) {
      } else {
        __pyx_t_13 = __pyx_t_15;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_16 = __pyx_v_b;
      __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
      __pyx_t_13 = __pyx_t_15;
      __pyx_L10_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/generated.pyx":8170
 *     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":8172
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_17 = __pyx_v_b;
    *__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":8173
 * 
 *         counts[b] += 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":8174
 *         counts[b] += 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_int64_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":8177
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:
 */
      __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":8178
 *             # not nan
 *             if val == val:
 *                 nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                 if nobs[b, j] == rank:
 *                     resx[b, j] = val
 */
        __pyx_t_22 = __pyx_v_b;
        __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":8179
 *             if val == val:
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:             # <<<<<<<<<<<<<<
 *                     resx[b, j] = val
 * 
 */
        __pyx_t_24 = __pyx_v_b;
        __pyx_t_25 = __pyx_v_j;
        __pyx_t_13 = (((*__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_13) {

          /* "pandas/src/generated.pyx":8180
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:
 *                     resx[b, j] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
          __pyx_t_26 = __pyx_v_b;
          __pyx_t_27 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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_L15;
        }
        __pyx_L15:;
        goto __pyx_L14;
      }
      __pyx_L14:;
    }
  }

  /* "pandas/src/generated.pyx":8182
 *                     resx[b, j] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_10 = __pyx_v_ngroups;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":8183
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = iNaT
 */
    __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":8184
 *     for i in range(ngroups):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = iNaT
 *             else:
 */
      __pyx_t_28 = __pyx_v_i;
      __pyx_t_29 = __pyx_v_j;
      __pyx_t_13 = (((*__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_13) {

        /* "pandas/src/generated.pyx":8185
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = iNaT             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = resx[i, j]
 */
        __pyx_t_30 = __pyx_v_i;
        __pyx_t_31 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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_iNaT;
        goto __pyx_L20;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8187
 *                 out[i, j] = iNaT
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @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_int64_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_int64_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_L20:;
    }
  }

  /* "pandas/src/generated.pyx":8145
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin_int64(ndarray[int64_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);
  { 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_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_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":8191
 * @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_449group_min_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_448group_min_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_449group_min_float64 = {"group_min_float64", (PyCFunction)__pyx_pw_6pandas_5algos_449group_min_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_448group_min_float64};
static PyObject *__pyx_pw_6pandas_5algos_449group_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 = 8191; __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 = 8191; __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 = 8191; __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 = 8191; __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 = 8191; __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 = 8191; __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 = 8192; __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 = 8193; __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 = 8194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_448group_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_448group_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;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  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;
  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;
  long __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;
  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 = 8191; __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 = 8191; __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 = 8191; __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 = 8191; __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":8203
 *         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 = 8203; __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 = 8203; __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":8204
 * 
 *     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__276, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8204; __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 = 8204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":8206
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     minx = np.empty_like(out)
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8206; __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 = 8206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 8206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8208
 *     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 = 8208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8208; __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_7); __pyx_t_7 = 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 = 8208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.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_12, &__pyx_t_11, &__pyx_t_10);
      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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_minx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8209
 * 
 *     minx = np.empty_like(out)
 *     minx.fill(np.inf)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8211
 *     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 = 8211; __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 = 8211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_13 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_13);
    #else
    __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    #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[2]; __pyx_lineno = 8211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_7 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    index = 1; __pyx_t_13 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_13)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_13);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":8213
 *     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":8214
 * 
 *     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":8215
 *     if K > 1:
 *         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/src/generated.pyx":8216
 *         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":8217
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":8219
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_16 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":8220
 * 
 *             counts[lab] += 1
 *             for j in range(K):             # <<<<<<<<<<<<<<
 *                 val = values[i, j]
 * 
 */
      __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/src/generated.pyx":8221
 *             counts[lab] += 1
 *             for j in range(K):
 *                 val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *                 # not nan
 */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        __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/src/generated.pyx":8224
 * 
 *                 # 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":8225
 *                 # not nan
 *                 if val == val:
 *                     nobs[lab, j] += 1             # <<<<<<<<<<<<<<
 *                     if val < minx[lab, j]:
 *                         minx[lab, j] = val
 */
          __pyx_t_21 = __pyx_v_lab;
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_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) += 1.0;

          /* "pandas/src/generated.pyx":8226
 *                 if val == val:
 *                     nobs[lab, j] += 1
 *                     if val < minx[lab, j]:             # <<<<<<<<<<<<<<
 *                         minx[lab, j] = val
 *     else:
 */
          __pyx_t_23 = __pyx_v_lab;
          __pyx_t_24 = __pyx_v_j;
          __pyx_t_3 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0);
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":8227
 *                     nobs[lab, j] += 1
 *                     if val < minx[lab, j]:
 *                         minx[lab, j] = val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
            __pyx_t_25 = __pyx_v_lab;
            __pyx_t_26 = __pyx_v_j;
            *__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) = __pyx_v_val;
            goto __pyx_L13;
          }
          __pyx_L13:;
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      __pyx_L7_continue:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8229
 *                         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":8230
 *     else:
 *         for i in range(N):
 *             lab = labels[i]             # <<<<<<<<<<<<<<
 *             if lab < 0:
 *                 continue
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8231
 *         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":8232
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L14_continue;
      }

      /* "pandas/src/generated.pyx":8234
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_18 = __pyx_v_lab;
      *__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":8235
 * 
 *             counts[lab] += 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":8238
 * 
 *             # 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":8239
 *             # not nan
 *             if val == val:
 *                 nobs[lab, 0] += 1             # <<<<<<<<<<<<<<
 *                 if val < minx[lab, 0]:
 *                     minx[lab, 0] = val
 */
        __pyx_t_29 = __pyx_v_lab;
        __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":8240
 *             if val == val:
 *                 nobs[lab, 0] += 1
 *                 if val < minx[lab, 0]:             # <<<<<<<<<<<<<<
 *                     minx[lab, 0] = val
 * 
 */
        __pyx_t_31 = __pyx_v_lab;
        __pyx_t_32 = 0;
        __pyx_t_3 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":8241
 *                 nobs[lab, 0] += 1
 *                 if val < minx[lab, 0]:
 *                     minx[lab, 0] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(counts)):
 */
          __pyx_t_33 = __pyx_v_lab;
          __pyx_t_34 = 0;
          *__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) = __pyx_v_val;
          goto __pyx_L18;
        }
        __pyx_L18:;
        goto __pyx_L17;
      }
      __pyx_L17:;
      __pyx_L14_continue:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":8243
 *                     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 = 8243; __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":8244
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_35 = __pyx_v_K;
    for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) {
      __pyx_v_j = __pyx_t_36;

      /* "pandas/src/generated.pyx":8245
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_37 = __pyx_v_i;
      __pyx_t_38 = __pyx_v_j;
      __pyx_t_3 = (((*__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_3) {

        /* "pandas/src/generated.pyx":8246
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = minx[i, j]
 */
        __pyx_t_39 = __pyx_v_i;
        __pyx_t_40 = __pyx_v_j;
        *__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":8248
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = minx[i, j]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_41 = __pyx_v_i;
        __pyx_t_42 = __pyx_v_j;
        __pyx_t_43 = __pyx_v_i;
        __pyx_t_44 = __pyx_v_j;
        *__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_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_minx.diminfo[1].strides));
      }
      __pyx_L23:;
    }
  }

  /* "pandas/src/generated.pyx":8191
 * @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_7);
  __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_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":8251
 * @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_451group_min_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_450group_min_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_451group_min_float32 = {"group_min_float32", (PyCFunction)__pyx_pw_6pandas_5algos_451group_min_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_450group_min_float32};
static PyObject *__pyx_pw_6pandas_5algos_451group_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 = 8251; __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 = 8251; __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 = 8251; __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 = 8251; __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 = 8251; __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 = 8251; __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 = 8252; __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 = 8253; __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 = 8254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_450group_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_450group_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;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  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;
  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;
  long __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;
  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 = 8251; __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 = 8251; __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 = 8251; __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 = 8251; __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":8263
 *         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 = 8263; __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 = 8263; __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":8264
 * 
 *     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__277, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8264; __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 = 8264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":8266
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     minx = np.empty_like(out)
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8266; __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 = 8266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 8266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8268
 *     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 = 8268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8268; __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_7); __pyx_t_7 = 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 = 8268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_minx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8269
 * 
 *     minx = np.empty_like(out)
 *     minx.fill(np.inf)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8271
 *     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 = 8271; __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 = 8271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_13 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_13);
    #else
    __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    #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[2]; __pyx_lineno = 8271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_7 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    index = 1; __pyx_t_13 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_13)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_13);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":8273
 *     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":8274
 * 
 *     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":8275
 *     if K > 1:
 *         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/src/generated.pyx":8276
 *         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":8277
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":8279
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_16 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":8280
 * 
 *             counts[lab] += 1
 *             for j in range(K):             # <<<<<<<<<<<<<<
 *                 val = values[i, j]
 * 
 */
      __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/src/generated.pyx":8281
 *             counts[lab] += 1
 *             for j in range(K):
 *                 val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *                 # not nan
 */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        __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));

        /* "pandas/src/generated.pyx":8284
 * 
 *                 # 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":8285
 *                 # not nan
 *                 if val == val:
 *                     nobs[lab, j] += 1             # <<<<<<<<<<<<<<
 *                     if val < minx[lab, j]:
 *                         minx[lab, j] = val
 */
          __pyx_t_21 = __pyx_v_lab;
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_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) += 1.0;

          /* "pandas/src/generated.pyx":8286
 *                 if val == val:
 *                     nobs[lab, j] += 1
 *                     if val < minx[lab, j]:             # <<<<<<<<<<<<<<
 *                         minx[lab, j] = val
 *     else:
 */
          __pyx_t_23 = __pyx_v_lab;
          __pyx_t_24 = __pyx_v_j;
          __pyx_t_3 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0);
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":8287
 *                     nobs[lab, j] += 1
 *                     if val < minx[lab, j]:
 *                         minx[lab, j] = val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
            __pyx_t_25 = __pyx_v_lab;
            __pyx_t_26 = __pyx_v_j;
            *__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) = __pyx_v_val;
            goto __pyx_L13;
          }
          __pyx_L13:;
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      __pyx_L7_continue:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8289
 *                         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":8290
 *     else:
 *         for i in range(N):
 *             lab = labels[i]             # <<<<<<<<<<<<<<
 *             if lab < 0:
 *                 continue
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8291
 *         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":8292
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L14_continue;
      }

      /* "pandas/src/generated.pyx":8294
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_18 = __pyx_v_lab;
      *__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":8295
 * 
 *             counts[lab] += 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":8298
 * 
 *             # 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":8299
 *             # not nan
 *             if val == val:
 *                 nobs[lab, 0] += 1             # <<<<<<<<<<<<<<
 *                 if val < minx[lab, 0]:
 *                     minx[lab, 0] = val
 */
        __pyx_t_29 = __pyx_v_lab;
        __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":8300
 *             if val == val:
 *                 nobs[lab, 0] += 1
 *                 if val < minx[lab, 0]:             # <<<<<<<<<<<<<<
 *                     minx[lab, 0] = val
 * 
 */
        __pyx_t_31 = __pyx_v_lab;
        __pyx_t_32 = 0;
        __pyx_t_3 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":8301
 *                 nobs[lab, 0] += 1
 *                 if val < minx[lab, 0]:
 *                     minx[lab, 0] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(counts)):
 */
          __pyx_t_33 = __pyx_v_lab;
          __pyx_t_34 = 0;
          *__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) = __pyx_v_val;
          goto __pyx_L18;
        }
        __pyx_L18:;
        goto __pyx_L17;
      }
      __pyx_L17:;
      __pyx_L14_continue:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":8303
 *                     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 = 8303; __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":8304
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_35 = __pyx_v_K;
    for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) {
      __pyx_v_j = __pyx_t_36;

      /* "pandas/src/generated.pyx":8305
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_37 = __pyx_v_i;
      __pyx_t_38 = __pyx_v_j;
      __pyx_t_3 = (((*__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_3) {

        /* "pandas/src/generated.pyx":8306
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = minx[i, j]
 */
        __pyx_t_39 = __pyx_v_i;
        __pyx_t_40 = __pyx_v_j;
        *__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":8308
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = minx[i, j]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_41 = __pyx_v_i;
        __pyx_t_42 = __pyx_v_j;
        __pyx_t_43 = __pyx_v_i;
        __pyx_t_44 = __pyx_v_j;
        *__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_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_minx.diminfo[1].strides));
      }
      __pyx_L23:;
    }
  }

  /* "pandas/src/generated.pyx":8251
 * @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_7);
  __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_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":8311
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[int64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_453group_min_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_452group_min_int64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_453group_min_int64 = {"group_min_int64", (PyCFunction)__pyx_pw_6pandas_5algos_453group_min_int64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_452group_min_int64};
static PyObject *__pyx_pw_6pandas_5algos_453group_min_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_min_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_min_int64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8311; __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_int64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8311; __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_int64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8311; __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_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8311; __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_int64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8311; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_min_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 = 8311; __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 = 8312; __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 = 8313; __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 = 8314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_452group_min_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_452group_min_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_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_lab;
  __pyx_t_5numpy_int64_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;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(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_int64", 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_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8311; __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 = 8311; __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 = 8311; __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 = 8311; __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":8323
 *         ndarray[int64_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 = 8323; __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 = 8323; __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":8324
 * 
 *     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__278, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8324; __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 = 8324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":8326
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     minx = np.empty_like(out)
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8326; __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 = 8326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 8326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8328
 *     nobs = np.zeros_like(out)
 * 
 *     minx = np.empty_like(out)             # <<<<<<<<<<<<<<
 *     minx.fill(9223372036854775807)
 * 
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8328; __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_7); __pyx_t_7 = 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 = 8328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.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_12, &__pyx_t_11, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_v_minx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_minx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8329
 * 
 *     minx = np.empty_like(out)
 *     minx.fill(9223372036854775807)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__279, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8329; __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_7); __pyx_t_7 = 0;

  /* "pandas/src/generated.pyx":8331
 *     minx.fill(9223372036854775807)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
    PyObject* sequence = __pyx_t_7;
    #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 = 8331; __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 = 8331; __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 = 8331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_13(__pyx_t_6); 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_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8331; __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 = 8331; __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 = 8331; __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":8333
 *     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":8334
 * 
 *     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":8335
 *     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":8336
 *         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":8337
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":8339
 *                 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":8340
 * 
 *             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":8341
 *             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_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));

        /* "pandas/src/generated.pyx":8344
 * 
 *                 # 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":8345
 *                 # 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_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) += 1;

          /* "pandas/src/generated.pyx":8346
 *                 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_int64_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":8347
 *                     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_int64_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":8349
 *                         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":8350
 *     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":8351
 *         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":8352
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L14_continue;
      }

      /* "pandas/src/generated.pyx":8354
 *                 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":8355
 * 
 *             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_int64_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":8358
 * 
 *             # 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":8359
 *             # 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_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) += 1;

        /* "pandas/src/generated.pyx":8360
 *             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_int64_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":8361
 *                 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_int64_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":8363
 *                     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 = 8363; __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":8364
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = iNaT
 */
    __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":8365
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = iNaT
 *             else:
 */
      __pyx_t_36 = __pyx_v_i;
      __pyx_t_37 = __pyx_v_j;
      __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":8366
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = iNaT             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = minx[i, j]
 */
        __pyx_t_38 = __pyx_v_i;
        __pyx_t_39 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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_iNaT;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8368
 *                 out[i, j] = iNaT
 *             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_int64_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_int64_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":8311
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_int64(ndarray[int64_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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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_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_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":8372
 * @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_455group_min_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_454group_min_bin_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_455group_min_bin_float64 = {"group_min_bin_float64", (PyCFunction)__pyx_pw_6pandas_5algos_455group_min_bin_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_454group_min_bin_float64};
static PyObject *__pyx_pw_6pandas_5algos_455group_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 = 8372; __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 = 8372; __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 = 8372; __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 = 8372; __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 = 8372; __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 = 8372; __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 = 8373; __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 = 8374; __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 = 8375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_454group_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_454group_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  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 = 8372; __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 = 8372; __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 = 8372; __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 = 8372; __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":8384
 *         ndarray[float64_t, ndim=2] minx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     minx = np.empty_like(out)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8384; __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 = 8384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8384; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8384; __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_3); __pyx_t_3 = 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 = 8384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8386
 *     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 = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_minx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8387
 * 
 *     minx = np.empty_like(out)
 *     minx.fill(np.inf)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8387; __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_t_2 = NULL;
    PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8387; __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8389
 *     minx.fill(np.inf)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (__pyx_t_11 - 1);
  __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8389; __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_12, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_13) != 0);
  if (__pyx_t_14) {

    /* "pandas/src/generated.pyx":8390
 * 
 *     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 = 8390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_13;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8392
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_13 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":8394
 *         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 = 8394; __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 = 8394; __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_10 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_10);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_15 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_15(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_10 = __pyx_t_15(__pyx_t_3); if (unlikely(!__pyx_t_10)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_10);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_15 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_N = __pyx_t_13;
  __pyx_v_K = __pyx_t_11;

  /* "pandas/src/generated.pyx":8396
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":8397
 * 
 *     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":8398
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_11 = __pyx_v_N;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_11; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "pandas/src/generated.pyx":8399
 *     if K > 1:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
        if (__pyx_t_16) {
        } else {
          __pyx_t_14 = __pyx_t_16;
          goto __pyx_L11_bool_binop_done;
        }
        __pyx_t_17 = __pyx_v_b;
        __pyx_t_16 = ((__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_14 = __pyx_t_16;
        __pyx_L11_bool_binop_done:;
        if (!__pyx_t_14) break;

        /* "pandas/src/generated.pyx":8400
 *         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":8402
 *                 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":8403
 * 
 *             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":8404
 *             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":8407
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     if val < minx[b, j]:
 */
        __pyx_t_14 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_14) {

          /* "pandas/src/generated.pyx":8408
 *                 # 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":8409
 *                 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_14 = ((__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_14) {

            /* "pandas/src/generated.pyx":8410
 *                     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_L16;
          }
          __pyx_L16:;
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8412
 *                         minx[b, j] = val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_11 = __pyx_v_N;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_11; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "pandas/src/generated.pyx":8413
 *     else:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
        if (__pyx_t_16) {
        } else {
          __pyx_t_14 = __pyx_t_16;
          goto __pyx_L21_bool_binop_done;
        }
        __pyx_t_19 = __pyx_v_b;
        __pyx_t_16 = ((__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_14 = __pyx_t_16;
        __pyx_L21_bool_binop_done:;
        if (!__pyx_t_14) break;

        /* "pandas/src/generated.pyx":8414
 *         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":8416
 *                 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":8417
 * 
 *             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":8420
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 if val < minx[b, 0]:
 */
      __pyx_t_14 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_14) {

        /* "pandas/src/generated.pyx":8421
 *             # 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":8422
 *             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_14 = ((__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_14) {

          /* "pandas/src/generated.pyx":8423
 *                 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_L24;
        }
        __pyx_L24:;
        goto __pyx_L23;
      }
      __pyx_L23:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":8425
 *                     minx[b, 0] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_11 = __pyx_v_ngroups;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_11; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "pandas/src/generated.pyx":8426
 * 
 *     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":8427
 *     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_14 = (((*__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_14) {

        /* "pandas/src/generated.pyx":8428
 *         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_L29;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8430
 *                 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_L29:;
    }
  }

  /* "pandas/src/generated.pyx":8372
 * @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_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_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":8433
 * @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_457group_min_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_456group_min_bin_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_457group_min_bin_float32 = {"group_min_bin_float32", (PyCFunction)__pyx_pw_6pandas_5algos_457group_min_bin_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_456group_min_bin_float32};
static PyObject *__pyx_pw_6pandas_5algos_457group_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 = 8433; __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 = 8433; __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 = 8433; __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 = 8433; __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 = 8433; __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 = 8433; __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 = 8434; __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 = 8435; __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 = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_456group_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_456group_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  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 = 8433; __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 = 8433; __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 = 8433; __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 = 8433; __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":8445
 *         ndarray[float32_t, ndim=2] minx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     minx = np.empty_like(out)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8445; __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 = 8445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8445; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8445; __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_3); __pyx_t_3 = 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 = 8445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8447
 *     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 = 8447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8447; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8447; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_minx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8448
 * 
 *     minx = np.empty_like(out)
 *     minx.fill(np.inf)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8448; __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_t_2 = NULL;
    PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8448; __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8450
 *     minx.fill(np.inf)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (__pyx_t_11 - 1);
  __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8450; __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_12, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_13) != 0);
  if (__pyx_t_14) {

    /* "pandas/src/generated.pyx":8451
 * 
 *     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 = 8451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_13;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8453
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_13 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":8455
 *         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 = 8455; __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 = 8455; __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_10 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_10);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_15 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_15(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_10 = __pyx_t_15(__pyx_t_3); if (unlikely(!__pyx_t_10)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_10);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_15 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_N = __pyx_t_13;
  __pyx_v_K = __pyx_t_11;

  /* "pandas/src/generated.pyx":8457
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":8458
 * 
 *     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":8459
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_11 = __pyx_v_N;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_11; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "pandas/src/generated.pyx":8460
 *     if K > 1:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
        if (__pyx_t_16) {
        } else {
          __pyx_t_14 = __pyx_t_16;
          goto __pyx_L11_bool_binop_done;
        }
        __pyx_t_17 = __pyx_v_b;
        __pyx_t_16 = ((__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_14 = __pyx_t_16;
        __pyx_L11_bool_binop_done:;
        if (!__pyx_t_14) break;

        /* "pandas/src/generated.pyx":8461
 *         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":8463
 *                 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":8464
 * 
 *             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":8465
 *             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":8468
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     if val < minx[b, j]:
 */
        __pyx_t_14 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_14) {

          /* "pandas/src/generated.pyx":8469
 *                 # 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":8470
 *                 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_14 = ((__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_14) {

            /* "pandas/src/generated.pyx":8471
 *                     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_L16;
          }
          __pyx_L16:;
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8473
 *                         minx[b, j] = val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_11 = __pyx_v_N;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_11; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "pandas/src/generated.pyx":8474
 *     else:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
        if (__pyx_t_16) {
        } else {
          __pyx_t_14 = __pyx_t_16;
          goto __pyx_L21_bool_binop_done;
        }
        __pyx_t_19 = __pyx_v_b;
        __pyx_t_16 = ((__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_14 = __pyx_t_16;
        __pyx_L21_bool_binop_done:;
        if (!__pyx_t_14) break;

        /* "pandas/src/generated.pyx":8475
 *         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":8477
 *                 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":8478
 * 
 *             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":8481
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 if val < minx[b, 0]:
 */
      __pyx_t_14 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_14) {

        /* "pandas/src/generated.pyx":8482
 *             # 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":8483
 *             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_14 = ((__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_14) {

          /* "pandas/src/generated.pyx":8484
 *                 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_L24;
        }
        __pyx_L24:;
        goto __pyx_L23;
      }
      __pyx_L23:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":8486
 *                     minx[b, 0] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_11 = __pyx_v_ngroups;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_11; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "pandas/src/generated.pyx":8487
 * 
 *     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":8488
 *     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_14 = (((*__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_14) {

        /* "pandas/src/generated.pyx":8489
 *         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_L29;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8491
 *                 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_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_L29:;
    }
  }

  /* "pandas/src/generated.pyx":8433
 * @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_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_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":8494
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[int64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_459group_min_bin_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_458group_min_bin_int64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_459group_min_bin_int64 = {"group_min_bin_int64", (PyCFunction)__pyx_pw_6pandas_5algos_459group_min_bin_int64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_458group_min_bin_int64};
static PyObject *__pyx_pw_6pandas_5algos_459group_min_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_min_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_min_bin_int64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8494; __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_int64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8494; __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_int64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8494; __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_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8494; __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_int64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_min_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 = 8494; __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 = 8495; __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 = 8496; __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 = 8497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_458group_min_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_458group_min_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_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_b;
  __pyx_t_5numpy_int64_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __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;
  long __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("group_min_bin_int64", 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_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8494; __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 = 8494; __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 = 8494; __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 = 8494; __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":8506
 *         ndarray[int64_t, ndim=2] minx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     minx = np.empty_like(out)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8506; __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 = 8506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8506; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8506; __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_3); __pyx_t_3 = 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 = 8506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8508
 *     nobs = np.zeros_like(out)
 * 
 *     minx = np.empty_like(out)             # <<<<<<<<<<<<<<
 *     minx.fill(9223372036854775807)
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8508; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8508; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_minx.rcbuffer->pybuffer, (PyObject*)__pyx_v_minx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_minx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8509
 * 
 *     minx = np.empty_like(out)
 *     minx.fill(9223372036854775807)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__280, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8509; __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_4); __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8511
 *     minx.fill(9223372036854775807)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_10 - 1);
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_12) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":8512
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_12;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8514
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_12 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":8516
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __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 = 8516; __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 = 8516; __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 = 8516; __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 = 8516; __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_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_14(__pyx_t_3); 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_3); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __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 = 8516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_12;
  __pyx_v_K = __pyx_t_10;

  /* "pandas/src/generated.pyx":8518
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":8519
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_t_13 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":8520
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_10 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/generated.pyx":8521
 *     if K > 1:
 *         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) {
        } else {
          __pyx_t_13 = __pyx_t_15;
          goto __pyx_L11_bool_binop_done;
        }
        __pyx_t_16 = __pyx_v_b;
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_15;
        __pyx_L11_bool_binop_done:;
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":8522
 *         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":8524
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_17 = __pyx_v_b;
      *__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":8525
 * 
 *             counts[b] += 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":8526
 *             counts[b] += 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_int64_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":8529
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     if val < minx[b, j]:
 */
        __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":8530
 *                 # not nan
 *                 if val == val:
 *                     nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                     if val < minx[b, j]:
 *                         minx[b, j] = val
 */
          __pyx_t_22 = __pyx_v_b;
          __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":8531
 *                 if val == val:
 *                     nobs[b, j] += 1
 *                     if val < minx[b, j]:             # <<<<<<<<<<<<<<
 *                         minx[b, j] = val
 *     else:
 */
          __pyx_t_24 = __pyx_v_b;
          __pyx_t_25 = __pyx_v_j;
          __pyx_t_13 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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))) != 0);
          if (__pyx_t_13) {

            /* "pandas/src/generated.pyx":8532
 *                     nobs[b, j] += 1
 *                     if val < minx[b, j]:
 *                         minx[b, j] = val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
            __pyx_t_26 = __pyx_v_b;
            __pyx_t_27 = __pyx_v_j;
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val;
            goto __pyx_L16;
          }
          __pyx_L16:;
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8534
 *                         minx[b, j] = val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_10 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/generated.pyx":8535
 *     else:
 *         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) {
        } else {
          __pyx_t_13 = __pyx_t_15;
          goto __pyx_L21_bool_binop_done;
        }
        __pyx_t_18 = __pyx_v_b;
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_15;
        __pyx_L21_bool_binop_done:;
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":8536
 *         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":8538
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_19 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":8539
 * 
 *             counts[b] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_28 = __pyx_v_i;
      __pyx_t_29 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":8542
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 if val < minx[b, 0]:
 */
      __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":8543
 *             # not nan
 *             if val == val:
 *                 nobs[b, 0] += 1             # <<<<<<<<<<<<<<
 *                 if val < minx[b, 0]:
 *                     minx[b, 0] = val
 */
        __pyx_t_30 = __pyx_v_b;
        __pyx_t_31 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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) += 1;

        /* "pandas/src/generated.pyx":8544
 *             if val == val:
 *                 nobs[b, 0] += 1
 *                 if val < minx[b, 0]:             # <<<<<<<<<<<<<<
 *                     minx[b, 0] = val
 * 
 */
        __pyx_t_32 = __pyx_v_b;
        __pyx_t_33 = 0;
        __pyx_t_13 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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))) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":8545
 *                 nobs[b, 0] += 1
 *                 if val < minx[b, 0]:
 *                     minx[b, 0] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
          __pyx_t_34 = __pyx_v_b;
          __pyx_t_35 = 0;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val;
          goto __pyx_L24;
        }
        __pyx_L24:;
        goto __pyx_L23;
      }
      __pyx_L23:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":8547
 *                     minx[b, 0] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_10 = __pyx_v_ngroups;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":8548
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = iNaT
 */
    __pyx_t_36 = __pyx_v_K;
    for (__pyx_t_37 = 0; __pyx_t_37 < __pyx_t_36; __pyx_t_37+=1) {
      __pyx_v_j = __pyx_t_37;

      /* "pandas/src/generated.pyx":8549
 *     for i in range(ngroups):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = iNaT
 *             else:
 */
      __pyx_t_38 = __pyx_v_i;
      __pyx_t_39 = __pyx_v_j;
      __pyx_t_13 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":8550
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = iNaT             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = minx[i, j]
 */
        __pyx_t_40 = __pyx_v_i;
        __pyx_t_41 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_iNaT;
        goto __pyx_L29;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8552
 *                 out[i, j] = iNaT
 *             else:
 *                 out[i, j] = minx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __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_BufPtrStrided2d(__pyx_t_5numpy_int64_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_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_minx.diminfo[1].strides));
      }
      __pyx_L29:;
    }
  }

  /* "pandas/src/generated.pyx":8494
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_bin_int64(ndarray[int64_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);
  { 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_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_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":8556
 * @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_461group_max_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_460group_max_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_461group_max_float64 = {"group_max_float64", (PyCFunction)__pyx_pw_6pandas_5algos_461group_max_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_460group_max_float64};
static PyObject *__pyx_pw_6pandas_5algos_461group_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 = 8556; __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 = 8556; __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 = 8556; __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 = 8556; __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 = 8556; __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 = 8556; __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 = 8557; __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 = 8558; __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 = 8559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_460group_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_460group_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;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  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;
  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;
  long __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;
  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 = 8556; __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 = 8556; __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 = 8556; __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 = 8556; __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":8568
 *         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 = 8568; __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 = 8568; __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":8569
 * 
 *     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__281, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8569; __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 = 8569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":8571
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     maxx = np.empty_like(out)
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8571; __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 = 8571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 8571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8573
 *     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 = 8573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8573; __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_7); __pyx_t_7 = 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 = 8573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.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_12, &__pyx_t_11, &__pyx_t_10);
      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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_maxx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8574
 * 
 *     maxx = np.empty_like(out)
 *     maxx.fill(-np.inf)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8576
 *     maxx.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 = 8576; __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 = 8576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_13 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_13);
    #else
    __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    #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[2]; __pyx_lineno = 8576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_7 = __pyx_t_14(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    index = 1; __pyx_t_13 = __pyx_t_14(__pyx_t_5); if (unlikely(!__pyx_t_13)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_13);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = 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_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":8578
 *     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":8579
 * 
 *     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":8580
 *     if K > 1:
 *         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/src/generated.pyx":8581
 *         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":8582
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":8584
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_16 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":8585
 * 
 *             counts[lab] += 1
 *             for j in range(K):             # <<<<<<<<<<<<<<
 *                 val = values[i, j]
 * 
 */
      __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/src/generated.pyx":8586
 *             counts[lab] += 1
 *             for j in range(K):
 *                 val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *                 # not nan
 */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        __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/src/generated.pyx":8589
 * 
 *                 # 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":8590
 *                 # not nan
 *                 if val == val:
 *                     nobs[lab, j] += 1             # <<<<<<<<<<<<<<
 *                     if val > maxx[lab, j]:
 *                         maxx[lab, j] = val
 */
          __pyx_t_21 = __pyx_v_lab;
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_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) += 1.0;

          /* "pandas/src/generated.pyx":8591
 *                 if val == val:
 *                     nobs[lab, j] += 1
 *                     if val > maxx[lab, j]:             # <<<<<<<<<<<<<<
 *                         maxx[lab, j] = val
 *     else:
 */
          __pyx_t_23 = __pyx_v_lab;
          __pyx_t_24 = __pyx_v_j;
          __pyx_t_3 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0);
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":8592
 *                     nobs[lab, j] += 1
 *                     if val > maxx[lab, j]:
 *                         maxx[lab, j] = val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
            __pyx_t_25 = __pyx_v_lab;
            __pyx_t_26 = __pyx_v_j;
            *__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) = __pyx_v_val;
            goto __pyx_L13;
          }
          __pyx_L13:;
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      __pyx_L7_continue:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8594
 *                         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":8595
 *     else:
 *         for i in range(N):
 *             lab = labels[i]             # <<<<<<<<<<<<<<
 *             if lab < 0:
 *                 continue
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8596
 *         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":8597
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L14_continue;
      }

      /* "pandas/src/generated.pyx":8599
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_18 = __pyx_v_lab;
      *__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":8600
 * 
 *             counts[lab] += 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":8603
 * 
 *             # 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":8604
 *             # not nan
 *             if val == val:
 *                 nobs[lab, 0] += 1             # <<<<<<<<<<<<<<
 *                 if val > maxx[lab, 0]:
 *                     maxx[lab, 0] = val
 */
        __pyx_t_29 = __pyx_v_lab;
        __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":8605
 *             if val == val:
 *                 nobs[lab, 0] += 1
 *                 if val > maxx[lab, 0]:             # <<<<<<<<<<<<<<
 *                     maxx[lab, 0] = val
 * 
 */
        __pyx_t_31 = __pyx_v_lab;
        __pyx_t_32 = 0;
        __pyx_t_3 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":8606
 *                 nobs[lab, 0] += 1
 *                 if val > maxx[lab, 0]:
 *                     maxx[lab, 0] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(counts)):
 */
          __pyx_t_33 = __pyx_v_lab;
          __pyx_t_34 = 0;
          *__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) = __pyx_v_val;
          goto __pyx_L18;
        }
        __pyx_L18:;
        goto __pyx_L17;
      }
      __pyx_L17:;
      __pyx_L14_continue:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":8608
 *                     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 = 8608; __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":8609
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_35 = __pyx_v_K;
    for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) {
      __pyx_v_j = __pyx_t_36;

      /* "pandas/src/generated.pyx":8610
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_37 = __pyx_v_i;
      __pyx_t_38 = __pyx_v_j;
      __pyx_t_3 = (((*__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_3) {

        /* "pandas/src/generated.pyx":8611
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = maxx[i, j]
 */
        __pyx_t_39 = __pyx_v_i;
        __pyx_t_40 = __pyx_v_j;
        *__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":8613
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = maxx[i, j]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_41 = __pyx_v_i;
        __pyx_t_42 = __pyx_v_j;
        __pyx_t_43 = __pyx_v_i;
        __pyx_t_44 = __pyx_v_j;
        *__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_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_maxx.diminfo[1].strides));
      }
      __pyx_L23:;
    }
  }

  /* "pandas/src/generated.pyx":8556
 * @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_7);
  __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_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":8616
 * @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_463group_max_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_462group_max_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_463group_max_float32 = {"group_max_float32", (PyCFunction)__pyx_pw_6pandas_5algos_463group_max_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_462group_max_float32};
static PyObject *__pyx_pw_6pandas_5algos_463group_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 = 8616; __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 = 8616; __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 = 8616; __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 = 8616; __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 = 8616; __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 = 8616; __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 = 8617; __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 = 8618; __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 = 8619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_462group_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_462group_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;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  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;
  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;
  long __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;
  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 = 8616; __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 = 8616; __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 = 8616; __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 = 8616; __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":8628
 *         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 = 8628; __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 = 8628; __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":8629
 * 
 *     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__282, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8629; __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 = 8629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":8631
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     maxx = np.empty_like(out)
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8631; __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 = 8631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 8631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8633
 *     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 = 8633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8633; __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_7); __pyx_t_7 = 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 = 8633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_maxx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8634
 * 
 *     maxx = np.empty_like(out)
 *     maxx.fill(-np.inf)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_inf); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8636
 *     maxx.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 = 8636; __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 = 8636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_13 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_13);
    #else
    __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    #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[2]; __pyx_lineno = 8636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_7 = __pyx_t_14(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    index = 1; __pyx_t_13 = __pyx_t_14(__pyx_t_5); if (unlikely(!__pyx_t_13)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_13);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = 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_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_v_K = __pyx_t_1;

  /* "pandas/src/generated.pyx":8638
 *     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":8639
 * 
 *     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":8640
 *     if K > 1:
 *         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/src/generated.pyx":8641
 *         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":8642
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":8644
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_16 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":8645
 * 
 *             counts[lab] += 1
 *             for j in range(K):             # <<<<<<<<<<<<<<
 *                 val = values[i, j]
 * 
 */
      __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/src/generated.pyx":8646
 *             counts[lab] += 1
 *             for j in range(K):
 *                 val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *                 # not nan
 */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_j;
        __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));

        /* "pandas/src/generated.pyx":8649
 * 
 *                 # 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":8650
 *                 # not nan
 *                 if val == val:
 *                     nobs[lab, j] += 1             # <<<<<<<<<<<<<<
 *                     if val > maxx[lab, j]:
 *                         maxx[lab, j] = val
 */
          __pyx_t_21 = __pyx_v_lab;
          __pyx_t_22 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_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) += 1.0;

          /* "pandas/src/generated.pyx":8651
 *                 if val == val:
 *                     nobs[lab, j] += 1
 *                     if val > maxx[lab, j]:             # <<<<<<<<<<<<<<
 *                         maxx[lab, j] = val
 *     else:
 */
          __pyx_t_23 = __pyx_v_lab;
          __pyx_t_24 = __pyx_v_j;
          __pyx_t_3 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0);
          if (__pyx_t_3) {

            /* "pandas/src/generated.pyx":8652
 *                     nobs[lab, j] += 1
 *                     if val > maxx[lab, j]:
 *                         maxx[lab, j] = val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
            __pyx_t_25 = __pyx_v_lab;
            __pyx_t_26 = __pyx_v_j;
            *__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) = __pyx_v_val;
            goto __pyx_L13;
          }
          __pyx_L13:;
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      __pyx_L7_continue:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8654
 *                         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":8655
 *     else:
 *         for i in range(N):
 *             lab = labels[i]             # <<<<<<<<<<<<<<
 *             if lab < 0:
 *                 continue
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides));

      /* "pandas/src/generated.pyx":8656
 *         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":8657
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L14_continue;
      }

      /* "pandas/src/generated.pyx":8659
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_18 = __pyx_v_lab;
      *__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":8660
 * 
 *             counts[lab] += 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":8663
 * 
 *             # 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":8664
 *             # not nan
 *             if val == val:
 *                 nobs[lab, 0] += 1             # <<<<<<<<<<<<<<
 *                 if val > maxx[lab, 0]:
 *                     maxx[lab, 0] = val
 */
        __pyx_t_29 = __pyx_v_lab;
        __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":8665
 *             if val == val:
 *                 nobs[lab, 0] += 1
 *                 if val > maxx[lab, 0]:             # <<<<<<<<<<<<<<
 *                     maxx[lab, 0] = val
 * 
 */
        __pyx_t_31 = __pyx_v_lab;
        __pyx_t_32 = 0;
        __pyx_t_3 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0);
        if (__pyx_t_3) {

          /* "pandas/src/generated.pyx":8666
 *                 nobs[lab, 0] += 1
 *                 if val > maxx[lab, 0]:
 *                     maxx[lab, 0] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(counts)):
 */
          __pyx_t_33 = __pyx_v_lab;
          __pyx_t_34 = 0;
          *__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) = __pyx_v_val;
          goto __pyx_L18;
        }
        __pyx_L18:;
        goto __pyx_L17;
      }
      __pyx_L17:;
      __pyx_L14_continue:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":8668
 *                     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 = 8668; __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":8669
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_35 = __pyx_v_K;
    for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) {
      __pyx_v_j = __pyx_t_36;

      /* "pandas/src/generated.pyx":8670
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_37 = __pyx_v_i;
      __pyx_t_38 = __pyx_v_j;
      __pyx_t_3 = (((*__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_3) {

        /* "pandas/src/generated.pyx":8671
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = maxx[i, j]
 */
        __pyx_t_39 = __pyx_v_i;
        __pyx_t_40 = __pyx_v_j;
        *__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":8673
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = maxx[i, j]             # <<<<<<<<<<<<<<
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 */
        __pyx_t_41 = __pyx_v_i;
        __pyx_t_42 = __pyx_v_j;
        __pyx_t_43 = __pyx_v_i;
        __pyx_t_44 = __pyx_v_j;
        *__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_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_maxx.diminfo[1].strides));
      }
      __pyx_L23:;
    }
  }

  /* "pandas/src/generated.pyx":8616
 * @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_7);
  __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_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":8676
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[int64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_465group_max_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_464group_max_int64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_465group_max_int64 = {"group_max_int64", (PyCFunction)__pyx_pw_6pandas_5algos_465group_max_int64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_464group_max_int64};
static PyObject *__pyx_pw_6pandas_5algos_465group_max_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_max_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_max_int64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8676; __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_int64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8676; __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_int64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8676; __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_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8676; __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_int64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8676; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_max_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 = 8676; __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 = 8677; __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 = 8678; __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 = 8679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_464group_max_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_464group_max_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_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_lab;
  __pyx_t_5numpy_int64_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;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(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_int64", 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_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8676; __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 = 8676; __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 = 8676; __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 = 8676; __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":8688
 *         ndarray[int64_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 = 8688; __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 = 8688; __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":8689
 * 
 *     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__283, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8689; __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 = 8689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":8691
 *        raise AssertionError("len(index) != len(labels)")
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     maxx = np.empty_like(out)
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8691; __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 = 8691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 8691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.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_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_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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8693
 *     nobs = np.zeros_like(out)
 * 
 *     maxx = np.empty_like(out)             # <<<<<<<<<<<<<<
 *     maxx.fill(-9223372036854775807)
 * 
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8693; __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_7); __pyx_t_7 = 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 = 8693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.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_12, &__pyx_t_11, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_maxx = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8694
 * 
 *     maxx = np.empty_like(out)
 *     maxx.fill(-9223372036854775807)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__284, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8694; __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_7); __pyx_t_7 = 0;

  /* "pandas/src/generated.pyx":8696
 *     maxx.fill(-9223372036854775807)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
    PyObject* sequence = __pyx_t_7;
    #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 = 8696; __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 = 8696; __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 = 8696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_13(__pyx_t_6); 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_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8696; __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 = 8696; __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 = 8696; __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":8698
 *     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":8699
 * 
 *     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":8700
 *     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":8701
 *         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":8702
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L7_continue;
      }

      /* "pandas/src/generated.pyx":8704
 *                 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":8705
 * 
 *             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":8706
 *             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_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));

        /* "pandas/src/generated.pyx":8709
 * 
 *                 # 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":8710
 *                 # 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_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) += 1;

          /* "pandas/src/generated.pyx":8711
 *                 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_int64_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":8712
 *                     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_int64_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":8714
 *                         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":8715
 *     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":8716
 *         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":8717
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L14_continue;
      }

      /* "pandas/src/generated.pyx":8719
 *                 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":8720
 * 
 *             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_int64_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":8723
 * 
 *             # 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":8724
 *             # 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_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) += 1;

        /* "pandas/src/generated.pyx":8725
 *             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_int64_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":8726
 *                 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_int64_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":8728
 *                     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 = 8728; __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":8729
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = iNaT
 */
    __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":8730
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = iNaT
 *             else:
 */
      __pyx_t_36 = __pyx_v_i;
      __pyx_t_37 = __pyx_v_j;
      __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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);
      if (__pyx_t_3) {

        /* "pandas/src/generated.pyx":8731
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = iNaT             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = maxx[i, j]
 */
        __pyx_t_38 = __pyx_v_i;
        __pyx_t_39 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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_iNaT;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8733
 *                 out[i, j] = iNaT
 *             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_int64_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_int64_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":8676
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_int64(ndarray[int64_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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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_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_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":8737
 * @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_467group_max_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_466group_max_bin_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_467group_max_bin_float64 = {"group_max_bin_float64", (PyCFunction)__pyx_pw_6pandas_5algos_467group_max_bin_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_466group_max_bin_float64};
static PyObject *__pyx_pw_6pandas_5algos_467group_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 = 8737; __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 = 8737; __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 = 8737; __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 = 8737; __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 = 8737; __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 = 8737; __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 = 8738; __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 = 8739; __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 = 8740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_466group_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_466group_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  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 = 8737; __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 = 8737; __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 = 8737; __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 = 8737; __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":8749
 *         ndarray[float64_t, ndim=2] maxx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     maxx = np.empty_like(out)
 *     maxx.fill(-np.inf)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8749; __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 = 8749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8749; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8749; __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_3); __pyx_t_3 = 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 = 8749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8750
 * 
 *     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 = 8750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8750; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8750; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_maxx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8751
 *     nobs = np.zeros_like(out)
 *     maxx = np.empty_like(out)
 *     maxx.fill(-np.inf)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8751; __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8753
 *     maxx.fill(-np.inf)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (__pyx_t_11 - 1);
  __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8753; __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_12, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_13) != 0);
  if (__pyx_t_14) {

    /* "pandas/src/generated.pyx":8754
 * 
 *     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 = 8754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_13;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8756
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_13 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":8758
 *         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 = 8758; __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 = 8758; __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_10 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_10);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_15 = Py_TYPE(__pyx_t_2)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_15(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_10 = __pyx_t_15(__pyx_t_2); if (unlikely(!__pyx_t_10)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_10);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = NULL;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_15 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_N = __pyx_t_13;
  __pyx_v_K = __pyx_t_11;

  /* "pandas/src/generated.pyx":8760
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":8761
 * 
 *     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":8762
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_11 = __pyx_v_N;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_11; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "pandas/src/generated.pyx":8763
 *     if K > 1:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
        if (__pyx_t_16) {
        } else {
          __pyx_t_14 = __pyx_t_16;
          goto __pyx_L11_bool_binop_done;
        }
        __pyx_t_17 = __pyx_v_b;
        __pyx_t_16 = ((__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_14 = __pyx_t_16;
        __pyx_L11_bool_binop_done:;
        if (!__pyx_t_14) break;

        /* "pandas/src/generated.pyx":8764
 *         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":8766
 *                 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":8767
 * 
 *             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":8768
 *             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":8771
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     if val > maxx[b, j]:
 */
        __pyx_t_14 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_14) {

          /* "pandas/src/generated.pyx":8772
 *                 # 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":8773
 *                 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_14 = ((__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_14) {

            /* "pandas/src/generated.pyx":8774
 *                     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_L16;
          }
          __pyx_L16:;
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8776
 *                         maxx[b, j] = val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_11 = __pyx_v_N;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_11; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "pandas/src/generated.pyx":8777
 *     else:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
        if (__pyx_t_16) {
        } else {
          __pyx_t_14 = __pyx_t_16;
          goto __pyx_L21_bool_binop_done;
        }
        __pyx_t_19 = __pyx_v_b;
        __pyx_t_16 = ((__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_14 = __pyx_t_16;
        __pyx_L21_bool_binop_done:;
        if (!__pyx_t_14) break;

        /* "pandas/src/generated.pyx":8778
 *         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":8780
 *                 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":8781
 * 
 *             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":8784
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 if val > maxx[b, 0]:
 */
      __pyx_t_14 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_14) {

        /* "pandas/src/generated.pyx":8785
 *             # 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":8786
 *             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_14 = ((__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_14) {

          /* "pandas/src/generated.pyx":8787
 *                 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_L24;
        }
        __pyx_L24:;
        goto __pyx_L23;
      }
      __pyx_L23:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":8789
 *                     maxx[b, 0] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_11 = __pyx_v_ngroups;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_11; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "pandas/src/generated.pyx":8790
 * 
 *     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":8791
 *     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_14 = (((*__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_14) {

        /* "pandas/src/generated.pyx":8792
 *         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_L29;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8794
 *                 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_L29:;
    }
  }

  /* "pandas/src/generated.pyx":8737
 * @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_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_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":8797
 * @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_469group_max_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_468group_max_bin_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_469group_max_bin_float32 = {"group_max_bin_float32", (PyCFunction)__pyx_pw_6pandas_5algos_469group_max_bin_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_468group_max_bin_float32};
static PyObject *__pyx_pw_6pandas_5algos_469group_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 = 8797; __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 = 8797; __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 = 8797; __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 = 8797; __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 = 8797; __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 = 8797; __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 = 8798; __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 = 8799; __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 = 8800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_468group_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_468group_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  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 = 8797; __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 = 8797; __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 = 8797; __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 = 8797; __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":8809
 *         ndarray[float32_t, ndim=2] maxx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     maxx = np.empty_like(out)
 *     maxx.fill(-np.inf)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8809; __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 = 8809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8809; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8809; __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_3); __pyx_t_3 = 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 = 8809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8810
 * 
 *     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 = 8810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8810; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8810; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_maxx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8811
 *     nobs = np.zeros_like(out)
 *     maxx = np.empty_like(out)
 *     maxx.fill(-np.inf)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8811; __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8813
 *     maxx.fill(-np.inf)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (__pyx_t_11 - 1);
  __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8813; __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_12, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_13) != 0);
  if (__pyx_t_14) {

    /* "pandas/src/generated.pyx":8814
 * 
 *     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 = 8814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_13;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8816
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_13 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":8818
 *         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 = 8818; __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 = 8818; __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_10 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_10);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_15 = Py_TYPE(__pyx_t_2)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_15(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_10 = __pyx_t_15(__pyx_t_2); if (unlikely(!__pyx_t_10)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_10);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = NULL;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_15 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_N = __pyx_t_13;
  __pyx_v_K = __pyx_t_11;

  /* "pandas/src/generated.pyx":8820
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":8821
 * 
 *     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":8822
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_11 = __pyx_v_N;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_11; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "pandas/src/generated.pyx":8823
 *     if K > 1:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
        if (__pyx_t_16) {
        } else {
          __pyx_t_14 = __pyx_t_16;
          goto __pyx_L11_bool_binop_done;
        }
        __pyx_t_17 = __pyx_v_b;
        __pyx_t_16 = ((__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_14 = __pyx_t_16;
        __pyx_L11_bool_binop_done:;
        if (!__pyx_t_14) break;

        /* "pandas/src/generated.pyx":8824
 *         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":8826
 *                 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":8827
 * 
 *             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":8828
 *             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":8831
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     if val > maxx[b, j]:
 */
        __pyx_t_14 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_14) {

          /* "pandas/src/generated.pyx":8832
 *                 # 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":8833
 *                 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_14 = ((__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_14) {

            /* "pandas/src/generated.pyx":8834
 *                     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_L16;
          }
          __pyx_L16:;
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8836
 *                         maxx[b, j] = val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_11 = __pyx_v_N;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_11; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "pandas/src/generated.pyx":8837
 *     else:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_16 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
        if (__pyx_t_16) {
        } else {
          __pyx_t_14 = __pyx_t_16;
          goto __pyx_L21_bool_binop_done;
        }
        __pyx_t_19 = __pyx_v_b;
        __pyx_t_16 = ((__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_14 = __pyx_t_16;
        __pyx_L21_bool_binop_done:;
        if (!__pyx_t_14) break;

        /* "pandas/src/generated.pyx":8838
 *         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":8840
 *                 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":8841
 * 
 *             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":8844
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 if val > maxx[b, 0]:
 */
      __pyx_t_14 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_14) {

        /* "pandas/src/generated.pyx":8845
 *             # 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":8846
 *             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_14 = ((__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_14) {

          /* "pandas/src/generated.pyx":8847
 *                 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_L24;
        }
        __pyx_L24:;
        goto __pyx_L23;
      }
      __pyx_L23:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":8849
 *                     maxx[b, 0] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_11 = __pyx_v_ngroups;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_11; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "pandas/src/generated.pyx":8850
 * 
 *     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":8851
 *     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_14 = (((*__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_14) {

        /* "pandas/src/generated.pyx":8852
 *         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_L29;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8854
 *                 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_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_L29:;
    }
  }

  /* "pandas/src/generated.pyx":8797
 * @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_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_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":8857
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[int64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_471group_max_bin_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_470group_max_bin_int64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_471group_max_bin_int64 = {"group_max_bin_int64", (PyCFunction)__pyx_pw_6pandas_5algos_471group_max_bin_int64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_470group_max_bin_int64};
static PyObject *__pyx_pw_6pandas_5algos_471group_max_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_max_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_max_bin_int64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8857; __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_int64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8857; __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_int64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8857; __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_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8857; __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_int64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8857; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.algos.group_max_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 = 8857; __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 = 8858; __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 = 8859; __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 = 8860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_470group_max_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_470group_max_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_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_b;
  __pyx_t_5numpy_int64_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;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __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;
  long __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("group_max_bin_int64", 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_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8857; __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 = 8857; __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 = 8857; __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 = 8857; __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":8869
 *         ndarray[int64_t, ndim=2] maxx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     maxx = np.empty_like(out)
 *     maxx.fill(-9223372036854775807)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8869; __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 = 8869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8869; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8869; __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_3); __pyx_t_3 = 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 = 8869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_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_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8870
 * 
 *     nobs = np.zeros_like(out)
 *     maxx = np.empty_like(out)             # <<<<<<<<<<<<<<
 *     maxx.fill(-9223372036854775807)
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_out)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8870; __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 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_out));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8870; __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;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 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_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_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_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_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_maxx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/generated.pyx":8871
 *     nobs = np.zeros_like(out)
 *     maxx = np.empty_like(out)
 *     maxx.fill(-9223372036854775807)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__285, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8871; __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_4); __pyx_t_4 = 0;

  /* "pandas/src/generated.pyx":8873
 *     maxx.fill(-9223372036854775807)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_10 - 1);
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_12) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":8874
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_12;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8876
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_12 + 1);
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":8878
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __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 = 8878; __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 = 8878; __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 = 8878; __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 = 8878; __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_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_14(__pyx_t_3); 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_3); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __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 = 8878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_12;
  __pyx_v_K = __pyx_t_10;

  /* "pandas/src/generated.pyx":8880
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "pandas/src/generated.pyx":8881
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_t_13 = ((__pyx_v_K > 1) != 0);
  if (__pyx_t_13) {

    /* "pandas/src/generated.pyx":8882
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_10 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/generated.pyx":8883
 *     if K > 1:
 *         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) {
        } else {
          __pyx_t_13 = __pyx_t_15;
          goto __pyx_L11_bool_binop_done;
        }
        __pyx_t_16 = __pyx_v_b;
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_15;
        __pyx_L11_bool_binop_done:;
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":8884
 *         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":8886
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_17 = __pyx_v_b;
      *__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":8887
 * 
 *             counts[b] += 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":8888
 *             counts[b] += 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_int64_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":8891
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     if val > maxx[b, j]:
 */
        __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":8892
 *                 # not nan
 *                 if val == val:
 *                     nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                     if val > maxx[b, j]:
 *                         maxx[b, j] = val
 */
          __pyx_t_22 = __pyx_v_b;
          __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":8893
 *                 if val == val:
 *                     nobs[b, j] += 1
 *                     if val > maxx[b, j]:             # <<<<<<<<<<<<<<
 *                         maxx[b, j] = val
 *     else:
 */
          __pyx_t_24 = __pyx_v_b;
          __pyx_t_25 = __pyx_v_j;
          __pyx_t_13 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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))) != 0);
          if (__pyx_t_13) {

            /* "pandas/src/generated.pyx":8894
 *                     nobs[b, j] += 1
 *                     if val > maxx[b, j]:
 *                         maxx[b, j] = val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
            __pyx_t_26 = __pyx_v_b;
            __pyx_t_27 = __pyx_v_j;
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val;
            goto __pyx_L16;
          }
          __pyx_L16:;
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":8896
 *                         maxx[b, j] = val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_10 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/generated.pyx":8897
 *     else:
 *         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) {
        } else {
          __pyx_t_13 = __pyx_t_15;
          goto __pyx_L21_bool_binop_done;
        }
        __pyx_t_18 = __pyx_v_b;
        __pyx_t_15 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
        __pyx_t_13 = __pyx_t_15;
        __pyx_L21_bool_binop_done:;
        if (!__pyx_t_13) break;

        /* "pandas/src/generated.pyx":8898
 *         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":8900
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_19 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

      /* "pandas/src/generated.pyx":8901
 * 
 *             counts[b] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_28 = __pyx_v_i;
      __pyx_t_29 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_values.diminfo[1].strides));

      /* "pandas/src/generated.pyx":8904
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 if val > maxx[b, 0]:
 */
      __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":8905
 *             # not nan
 *             if val == val:
 *                 nobs[b, 0] += 1             # <<<<<<<<<<<<<<
 *                 if val > maxx[b, 0]:
 *                     maxx[b, 0] = val
 */
        __pyx_t_30 = __pyx_v_b;
        __pyx_t_31 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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) += 1;

        /* "pandas/src/generated.pyx":8906
 *             if val == val:
 *                 nobs[b, 0] += 1
 *                 if val > maxx[b, 0]:             # <<<<<<<<<<<<<<
 *                     maxx[b, 0] = val
 * 
 */
        __pyx_t_32 = __pyx_v_b;
        __pyx_t_33 = 0;
        __pyx_t_13 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_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))) != 0);
        if (__pyx_t_13) {

          /* "pandas/src/generated.pyx":8907
 *                 nobs[b, 0] += 1
 *                 if val > maxx[b, 0]:
 *                     maxx[b, 0] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
          __pyx_t_34 = __pyx_v_b;
          __pyx_t_35 = 0;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val;
          goto __pyx_L24;
        }
        __pyx_L24:;
        goto __pyx_L23;
      }
      __pyx_L23:;
    }
  }
  __pyx_L6:;

  /* "pandas/src/generated.pyx":8909
 *                     maxx[b, 0] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_10 = __pyx_v_ngroups;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/generated.pyx":8910
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = iNaT
 */
    __pyx_t_36 = __pyx_v_K;
    for (__pyx_t_37 = 0; __pyx_t_37 < __pyx_t_36; __pyx_t_37+=1) {
      __pyx_v_j = __pyx_t_37;

      /* "pandas/src/generated.pyx":8911
 *     for i in range(ngroups):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = iNaT
 *             else:
 */
      __pyx_t_38 = __pyx_v_i;
      __pyx_t_39 = __pyx_v_j;
      __pyx_t_13 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0);
      if (__pyx_t_13) {

        /* "pandas/src/generated.pyx":8912
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = iNaT             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = maxx[i, j]
 */
        __pyx_t_40 = __pyx_v_i;
        __pyx_t_41 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_iNaT;
        goto __pyx_L29;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":8914
 *                 out[i, j] = iNaT
 *             else:
 *                 out[i, j] = maxx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
        __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_BufPtrStrided2d(__pyx_t_5numpy_int64_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_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_maxx.diminfo[1].strides));
      }
      __pyx_L29:;
    }
  }

  /* "pandas/src/generated.pyx":8857
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_bin_int64(ndarray[int64_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);
  { 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_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_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":8918
 * @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_473group_count_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_472group_count_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_473group_count_float64 = {"group_count_float64", (PyCFunction)__pyx_pw_6pandas_5algos_473group_count_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_472group_count_float64};
static PyObject *__pyx_pw_6pandas_5algos_473group_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 = 8918; __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 = 8918; __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 = 8918; __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 = 8918; __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 = 8918; __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 = 8918; __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 = 8919; __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 = 8920; __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 = 8921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_472group_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_472group_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;
  __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_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 = 8918; __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 = 8918; __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 = 8918; __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 = 8918; __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":8927
 *     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":8929
 *         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 = 8929; __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 = 8929; __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 = 8929; __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 = 8929; __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 = 8929; __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 = 8929; __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 = 8929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":8930
 *         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 = 8930; __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 = 8930; __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 = 8929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":8929
 *         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 = 8929; __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 = 8929; __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 = 8929; __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":8932
 *                                                  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 = 8932; __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 = 8932; __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":8933
 * 
 *     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__286, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8933; __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 = 8933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":8935
 *        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":8936
 * 
 *     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":8937
 *     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":8938
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":8940
 *             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":8941
 * 
 *         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":8942
 *         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":8945
 * 
 *             # 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) {
      } else {
        __pyx_t_16 = __pyx_t_9;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_9 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT);
      __pyx_t_16 = __pyx_t_9;
      __pyx_L9_bool_binop_done:;
      __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":8947
 *             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 = 8947; __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":8948
 * 
 *     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":8949
 *     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":8918
 * @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":8954
 * @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_475group_count_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_474group_count_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_475group_count_float32 = {"group_count_float32", (PyCFunction)__pyx_pw_6pandas_5algos_475group_count_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_474group_count_float32};
static PyObject *__pyx_pw_6pandas_5algos_475group_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 = 8954; __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 = 8954; __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 = 8954; __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 = 8954; __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 = 8954; __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 = 8954; __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 = 8955; __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 = 8956; __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 = 8957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_474group_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_474group_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;
  __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_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 = 8954; __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 = 8954; __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 = 8954; __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 = 8954; __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":8963
 *     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":8965
 *         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 = 8965; __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 = 8965; __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 = 8965; __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 = 8965; __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 = 8965; __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 = 8965; __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 = 8965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":8966
 *         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 = 8966; __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 = 8966; __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 = 8965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":8965
 *         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 = 8965; __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 = 8965; __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 = 8965; __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":8968
 *                                                  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 = 8968; __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 = 8968; __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":8969
 * 
 *     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__287, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8969; __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 = 8969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":8971
 *        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":8972
 * 
 *     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":8973
 *     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":8974
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":8976
 *             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":8977
 * 
 *         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":8978
 *         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":8981
 * 
 *             # 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) {
      } else {
        __pyx_t_16 = __pyx_t_9;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_9 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT);
      __pyx_t_16 = __pyx_t_9;
      __pyx_L9_bool_binop_done:;
      __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":8983
 *             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 = 8983; __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":8984
 * 
 *     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":8985
 *     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_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_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":8954
 * @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":8990
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[int64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_477group_count_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_476group_count_int64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_477group_count_int64 = {"group_count_int64", (PyCFunction)__pyx_pw_6pandas_5algos_477group_count_int64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_476group_count_int64};
static PyObject *__pyx_pw_6pandas_5algos_477group_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 = 8990; __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 = 8990; __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 = 8990; __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 = 8990; __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 = 8990; __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 = 8990; __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 = 8991; __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 = 8992; __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 = 8993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_476group_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_476group_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;
  __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_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_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8990; __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 = 8990; __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 = 8990; __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 = 8990; __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":8999
 *     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":9001
 *         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 = 9001; __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 = 9001; __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 = 9001; __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 = 9001; __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 = 9001; __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 = 9001; __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 = 9001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":9002
 *         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 = 9002; __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 = 9002; __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 = 9001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":9001
 *         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 = 9001; __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 = 9001; __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 = 9001; __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":9004
 *                                                  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 = 9004; __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 = 9004; __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":9005
 * 
 *     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__288, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9005; __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 = 9005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":9007
 *        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":9008
 * 
 *     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":9009
 *     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":9010
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":9012
 *             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":9013
 * 
 *         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":9014
 *         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":9017
 * 
 *             # 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) {
      } else {
        __pyx_t_16 = __pyx_t_9;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_9 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT);
      __pyx_t_16 = __pyx_t_9;
      __pyx_L9_bool_binop_done:;
      __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":9019
 *             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 = 9019; __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":9020
 * 
 *     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":9021
 *     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_int64_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":8990
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_int64(ndarray[int64_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":9026
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[object, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_479group_count_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_478group_count_object[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_479group_count_object = {"group_count_object", (PyCFunction)__pyx_pw_6pandas_5algos_479group_count_object, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_478group_count_object};
static PyObject *__pyx_pw_6pandas_5algos_479group_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 = 9026; __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 = 9026; __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 = 9026; __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 = 9026; __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 = 9026; __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 = 9026; __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 = 9027; __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 = 9028; __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 = 9029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_478group_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_478group_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;
  __pyx_t_5numpy_int64_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  PyObject **__pyx_t_24;
  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_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9026; __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 = 9026; __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 = 9026; __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 = 9026; __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":9035
 *     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":9037
 *         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 = 9037; __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 = 9037; __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 = 9037; __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 = 9037; __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 = 9037; __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 = 9037; __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 = 9037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":9038
 *         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 = 9038; __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 = 9038; __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 = 9037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":9037
 *         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 = 9037; __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 = 9037; __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 = 9037; __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":9040
 *                                                  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 = 9040; __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 = 9040; __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":9041
 * 
 *     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__289, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9041; __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 = 9041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":9043
 *        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":9044
 * 
 *     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":9045
 *     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":9046
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":9048
 *             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":9049
 * 
 *         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":9050
 *         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":9053
 * 
 *             # 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 = 9053; __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 = 9053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_9) {
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_17 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_17 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_16 = __pyx_t_17;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5algos_iNaT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_17 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_17 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_16 = __pyx_t_17;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_L9_bool_binop_done:;
      __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_16;
    }
    __pyx_L4_continue:;
  }

  /* "pandas/src/generated.pyx":9055
 *             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 = 9055; __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":9056
 * 
 *     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":9057
 *     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_4 = __Pyx_PyInt_From_npy_int64((*__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))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_22 = __pyx_v_i;
      __pyx_t_23 = __pyx_v_j;
      __pyx_t_24 = __Pyx_BufPtrStrided2d(PyObject **, __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_GOTREF(*__pyx_t_24);
      __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(*__pyx_t_24);
      *__pyx_t_24 = __pyx_t_4;
      __Pyx_GIVEREF(*__pyx_t_24);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }

  /* "pandas/src/generated.pyx":9026
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_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_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":9062
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[int64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_481group_count_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_480group_count_int64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_481group_count_int64 = {"group_count_int64", (PyCFunction)__pyx_pw_6pandas_5algos_481group_count_int64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_480group_count_int64};
static PyObject *__pyx_pw_6pandas_5algos_481group_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 = 9062; __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 = 9062; __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 = 9062; __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 = 9062; __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 = 9062; __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 = 9062; __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 = 9063; __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 = 9064; __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 = 9065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_480group_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_480group_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;
  __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_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_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9062; __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 = 9062; __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 = 9062; __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 = 9062; __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":9071
 *     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":9073
 *         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 = 9073; __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 = 9073; __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 = 9073; __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 = 9073; __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 = 9073; __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 = 9073; __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 = 9073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":9074
 *         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 = 9074; __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 = 9074; __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 = 9073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":9073
 *         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 = 9073; __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 = 9073; __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 = 9073; __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":9076
 *                                                  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 = 9076; __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 = 9076; __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":9077
 * 
 *     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__290, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9077; __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 = 9077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/generated.pyx":9079
 *        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":9080
 * 
 *     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":9081
 *     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":9082
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L4_continue;
    }

    /* "pandas/src/generated.pyx":9084
 *             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":9085
 * 
 *         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":9086
 *         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":9089
 * 
 *             # 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) {
      } else {
        __pyx_t_16 = __pyx_t_9;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_9 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT);
      __pyx_t_16 = __pyx_t_9;
      __pyx_L9_bool_binop_done:;
      __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":9091
 *             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 = 9091; __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":9092
 * 
 *     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":9093
 *     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_int64_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":9062
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_int64(ndarray[int64_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":9099
 * @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_483group_count_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_482group_count_bin_float64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_483group_count_bin_float64 = {"group_count_bin_float64", (PyCFunction)__pyx_pw_6pandas_5algos_483group_count_bin_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_482group_count_bin_float64};
static PyObject *__pyx_pw_6pandas_5algos_483group_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 = 9099; __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 = 9099; __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 = 9099; __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 = 9099; __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 = 9099; __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 = 9099; __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 = 9100; __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 = 9101; __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 = 9102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_482group_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_482group_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;
  int __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;
  __pyx_t_5numpy_int64_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 = 9099; __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 = 9099; __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 = 9099; __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 = 9099; __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":9108
 *     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":9110
 *         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 = 9110; __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 = 9110; __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 = 9110; __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 = 9110; __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 = 9110; __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 = 9110; __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 = 9110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":9111
 *         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 = 9111; __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 = 9111; __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 = 9110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":9110
 *         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 = 9110; __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 = 9110; __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 = 9110; __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":9113
 *                                                  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 = 9113; __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 = 9113; __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":9115
 *     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":9116
 * 
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *             b += 1
 * 
 */
    while (1) {
      __pyx_t_11 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
      if (__pyx_t_11) {
      } else {
        __pyx_t_10 = __pyx_t_11;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_12 = __pyx_v_b;
      __pyx_t_11 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
      __pyx_t_10 = __pyx_t_11;
      __pyx_L7_bool_binop_done:;
      if (!__pyx_t_10) break;

      /* "pandas/src/generated.pyx":9117
 *     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":9119
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_13 = __pyx_v_b;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":9120
 * 
 *         counts[b] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __pyx_t_14 = __pyx_v_K;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "pandas/src/generated.pyx":9121
 *         counts[b] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_17 = __pyx_v_j;
      __pyx_v_val = (*__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));

      /* "pandas/src/generated.pyx":9124
 * 
 *             # not nan
 *             nobs[b, j] += val == val and val != iNaT             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
      __pyx_t_10 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_10) {
      } else {
        __pyx_t_18 = __pyx_t_10;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_10 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT);
      __pyx_t_18 = __pyx_t_10;
      __pyx_L11_bool_binop_done:;
      __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_18;
    }
  }

  /* "pandas/src/generated.pyx":9126
 *             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":9127
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             out[i, j] = nobs[i, j]
 * 
 */
    __pyx_t_14 = __pyx_v_K;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "pandas/src/generated.pyx":9128
 *     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":9099
 * @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":9133
 * @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_485group_count_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_484group_count_bin_float32[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_485group_count_bin_float32 = {"group_count_bin_float32", (PyCFunction)__pyx_pw_6pandas_5algos_485group_count_bin_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_484group_count_bin_float32};
static PyObject *__pyx_pw_6pandas_5algos_485group_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 = 9133; __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 = 9133; __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 = 9133; __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 = 9133; __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 = 9133; __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 = 9133; __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 = 9134; __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 = 9135; __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 = 9136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_484group_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_484group_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;
  int __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;
  __pyx_t_5numpy_int64_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 = 9133; __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 = 9133; __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 = 9133; __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 = 9133; __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":9142
 *     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":9144
 *         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 = 9144; __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 = 9144; __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 = 9144; __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 = 9144; __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 = 9144; __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 = 9144; __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 = 9144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":9145
 *         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 = 9145; __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 = 9145; __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 = 9144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":9144
 *         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 = 9144; __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 = 9144; __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 = 9144; __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":9147
 *                                                  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 = 9147; __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 = 9147; __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":9149
 *     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":9150
 * 
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *             b += 1
 * 
 */
    while (1) {
      __pyx_t_11 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
      if (__pyx_t_11) {
      } else {
        __pyx_t_10 = __pyx_t_11;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_12 = __pyx_v_b;
      __pyx_t_11 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
      __pyx_t_10 = __pyx_t_11;
      __pyx_L7_bool_binop_done:;
      if (!__pyx_t_10) break;

      /* "pandas/src/generated.pyx":9151
 *     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":9153
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_13 = __pyx_v_b;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":9154
 * 
 *         counts[b] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __pyx_t_14 = __pyx_v_K;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "pandas/src/generated.pyx":9155
 *         counts[b] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_17 = __pyx_v_j;
      __pyx_v_val = (*__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));

      /* "pandas/src/generated.pyx":9158
 * 
 *             # not nan
 *             nobs[b, j] += val == val and val != iNaT             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
      __pyx_t_10 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_10) {
      } else {
        __pyx_t_18 = __pyx_t_10;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_10 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT);
      __pyx_t_18 = __pyx_t_10;
      __pyx_L11_bool_binop_done:;
      __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_18;
    }
  }

  /* "pandas/src/generated.pyx":9160
 *             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":9161
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             out[i, j] = nobs[i, j]
 * 
 */
    __pyx_t_14 = __pyx_v_K;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "pandas/src/generated.pyx":9162
 *     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":9133
 * @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":9167
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[int64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_487group_count_bin_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_486group_count_bin_int64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_487group_count_bin_int64 = {"group_count_bin_int64", (PyCFunction)__pyx_pw_6pandas_5algos_487group_count_bin_int64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_486group_count_bin_int64};
static PyObject *__pyx_pw_6pandas_5algos_487group_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 = 9167; __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 = 9167; __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 = 9167; __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 = 9167; __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 = 9167; __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 = 9167; __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 = 9168; __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 = 9169; __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 = 9170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_486group_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_486group_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;
  int __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;
  __pyx_t_5numpy_int64_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_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9167; __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 = 9167; __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 = 9167; __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 = 9167; __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":9176
 *     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":9178
 *         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 = 9178; __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 = 9178; __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 = 9178; __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 = 9178; __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 = 9178; __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 = 9178; __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 = 9178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":9179
 *         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 = 9179; __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 = 9179; __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 = 9178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":9178
 *         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 = 9178; __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 = 9178; __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 = 9178; __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":9181
 *                                                  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 = 9181; __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 = 9181; __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":9183
 *     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":9184
 * 
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *             b += 1
 * 
 */
    while (1) {
      __pyx_t_11 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
      if (__pyx_t_11) {
      } else {
        __pyx_t_10 = __pyx_t_11;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_12 = __pyx_v_b;
      __pyx_t_11 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
      __pyx_t_10 = __pyx_t_11;
      __pyx_L7_bool_binop_done:;
      if (!__pyx_t_10) break;

      /* "pandas/src/generated.pyx":9185
 *     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":9187
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_13 = __pyx_v_b;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":9188
 * 
 *         counts[b] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __pyx_t_14 = __pyx_v_K;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "pandas/src/generated.pyx":9189
 *         counts[b] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_17 = __pyx_v_j;
      __pyx_v_val = (*__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));

      /* "pandas/src/generated.pyx":9192
 * 
 *             # not nan
 *             nobs[b, j] += val == val and val != iNaT             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
      __pyx_t_10 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_10) {
      } else {
        __pyx_t_18 = __pyx_t_10;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_10 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT);
      __pyx_t_18 = __pyx_t_10;
      __pyx_L11_bool_binop_done:;
      __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_18;
    }
  }

  /* "pandas/src/generated.pyx":9194
 *             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":9195
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             out[i, j] = nobs[i, j]
 * 
 */
    __pyx_t_14 = __pyx_v_K;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "pandas/src/generated.pyx":9196
 *     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_int64_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":9167
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_int64(ndarray[int64_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":9201
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[object, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_489group_count_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_488group_count_bin_object[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_489group_count_bin_object = {"group_count_bin_object", (PyCFunction)__pyx_pw_6pandas_5algos_489group_count_bin_object, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_488group_count_bin_object};
static PyObject *__pyx_pw_6pandas_5algos_489group_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 = 9201; __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 = 9201; __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 = 9201; __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 = 9201; __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 = 9201; __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 = 9201; __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 = 9202; __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 = 9203; __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 = 9204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_488group_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_488group_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;
  int __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;
  __pyx_t_5numpy_int64_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;
  PyObject **__pyx_t_26;
  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_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9201; __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 = 9201; __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 = 9201; __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 = 9201; __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":9210
 *     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":9212
 *         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 = 9212; __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 = 9212; __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 = 9212; __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 = 9212; __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 = 9212; __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 = 9212; __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 = 9212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":9213
 *         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 = 9213; __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 = 9213; __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 = 9212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":9212
 *         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 = 9212; __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 = 9212; __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 = 9212; __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":9215
 *                                                  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 = 9215; __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 = 9215; __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":9217
 *     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":9218
 * 
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *             b += 1
 * 
 */
    while (1) {
      __pyx_t_11 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
      if (__pyx_t_11) {
      } else {
        __pyx_t_10 = __pyx_t_11;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_12 = __pyx_v_b;
      __pyx_t_11 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
      __pyx_t_10 = __pyx_t_11;
      __pyx_L7_bool_binop_done:;
      if (!__pyx_t_10) break;

      /* "pandas/src/generated.pyx":9219
 *     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":9221
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_13 = __pyx_v_b;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":9222
 * 
 *         counts[b] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __pyx_t_14 = __pyx_v_K;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "pandas/src/generated.pyx":9223
 *         counts[b] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_17 = __pyx_v_j;
      __pyx_t_5 = (PyObject *) *__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_INCREF((PyObject*)__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "pandas/src/generated.pyx":9226
 * 
 *             # 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 = 9226; __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[2]; __pyx_lineno = 9226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_10) {
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_19 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_19 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_18 = __pyx_t_19;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5algos_iNaT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__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 = 9226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_18 = __pyx_t_19;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_L11_bool_binop_done:;
      __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_18;
    }
  }

  /* "pandas/src/generated.pyx":9228
 *             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":9229
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             out[i, j] = nobs[i, j]
 * 
 */
    __pyx_t_14 = __pyx_v_K;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "pandas/src/generated.pyx":9230
 *     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_4 = __Pyx_PyInt_From_npy_int64((*__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))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_24 = __pyx_v_i;
      __pyx_t_25 = __pyx_v_j;
      __pyx_t_26 = __Pyx_BufPtrStrided2d(PyObject **, __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_GOTREF(*__pyx_t_26);
      __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(*__pyx_t_26);
      *__pyx_t_26 = __pyx_t_4;
      __Pyx_GIVEREF(*__pyx_t_26);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }

  /* "pandas/src/generated.pyx":9201
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_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_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":9235
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[int64_t, ndim=2] values,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_491group_count_bin_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_490group_count_bin_int64[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_491group_count_bin_int64 = {"group_count_bin_int64", (PyCFunction)__pyx_pw_6pandas_5algos_491group_count_bin_int64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_490group_count_bin_int64};
static PyObject *__pyx_pw_6pandas_5algos_491group_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 = 9235; __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 = 9235; __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 = 9235; __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 = 9235; __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 = 9235; __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 = 9235; __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 = 9236; __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 = 9237; __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 = 9238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_490group_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_490group_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;
  int __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;
  __pyx_t_5numpy_int64_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_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9235; __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 = 9235; __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 = 9235; __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 = 9235; __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":9244
 *     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":9246
 *         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 = 9246; __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 = 9246; __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 = 9246; __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 = 9246; __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 = 9246; __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 = 9246; __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 = 9246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/src/generated.pyx":9247
 *         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 = 9247; __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 = 9247; __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 = 9246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/generated.pyx":9246
 *         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 = 9246; __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 = 9246; __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 = 9246; __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":9249
 *                                                  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 = 9249; __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 = 9249; __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":9251
 *     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":9252
 * 
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *             b += 1
 * 
 */
    while (1) {
      __pyx_t_11 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0);
      if (__pyx_t_11) {
      } else {
        __pyx_t_10 = __pyx_t_11;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_12 = __pyx_v_b;
      __pyx_t_11 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0);
      __pyx_t_10 = __pyx_t_11;
      __pyx_L7_bool_binop_done:;
      if (!__pyx_t_10) break;

      /* "pandas/src/generated.pyx":9253
 *     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":9255
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_13 = __pyx_v_b;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides) += 1;

    /* "pandas/src/generated.pyx":9256
 * 
 *         counts[b] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __pyx_t_14 = __pyx_v_K;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "pandas/src/generated.pyx":9257
 *         counts[b] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_17 = __pyx_v_j;
      __pyx_v_val = (*__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));

      /* "pandas/src/generated.pyx":9260
 * 
 *             # not nan
 *             nobs[b, j] += val == val and val != iNaT             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
      __pyx_t_10 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_10) {
      } else {
        __pyx_t_18 = __pyx_t_10;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_10 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT);
      __pyx_t_18 = __pyx_t_10;
      __pyx_L11_bool_binop_done:;
      __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_18;
    }
  }

  /* "pandas/src/generated.pyx":9262
 *             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":9263
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             out[i, j] = nobs[i, j]
 * 
 */
    __pyx_t_14 = __pyx_v_K;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "pandas/src/generated.pyx":9264
 *     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_int64_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":9235
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_int64(ndarray[int64_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":9270
 * @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_493left_join_indexer_unique_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_493left_join_indexer_unique_float64 = {"left_join_indexer_unique_float64", (PyCFunction)__pyx_pw_6pandas_5algos_493left_join_indexer_unique_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_493left_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 = 9270; __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 = 9270; __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 = 9270; __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 = 9270; __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 = 9271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_492left_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_492left_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;
  int __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("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 = 9270; __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 = 9270; __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":9277
 *         float64_t lval, rval
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     nleft = len(left)
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":9278
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     nleft = len(left)
 *     nright = len(right)
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":9279
 *     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 = 9279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":9280
 *     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 = 9280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":9282
 *     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 = 9282; __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 = 9282; __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 = 9282; __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 = 9282; __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 = 9282; __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 = 9282; __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 = 9282; __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 = 9282; __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 = 9282; __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 = 9282; __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 = 9282; __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":9283
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)
 *     while True:             # <<<<<<<<<<<<<<
 *         if i == nleft:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":9284
 *     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":9285
 *     while True:
 *         if i == nleft:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if j == nright:
 */
      goto __pyx_L4_break;
    }

    /* "pandas/src/generated.pyx":9287
 *             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":9288
 * 
 *         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":9289
 *         if j == nright:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "pandas/src/generated.pyx":9290
 *             indexer[i] = -1
 *             i += 1
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         rval = right[j]
 */
      goto __pyx_L3_continue;
    }

    /* "pandas/src/generated.pyx":9292
 *             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":9294
 *         rval = right[j]
 * 
 *         while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    while (1) {
      __pyx_t_14 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
      if (__pyx_t_14) {
      } else {
        __pyx_t_12 = __pyx_t_14;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0);
      __pyx_t_12 = __pyx_t_14;
      __pyx_L9_bool_binop_done:;
      if (!__pyx_t_12) break;

      /* "pandas/src/generated.pyx":9295
 * 
 *         while i < nleft - 1 and left[i] == rval:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 * 
 */
      __pyx_t_16 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":9296
 *         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":9298
 *             i += 1
 * 
 *         if left[i] == right[j]:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_t_18 = __pyx_v_j;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_left.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":9299
 * 
 *         if left[i] == right[j]:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 */
      __pyx_t_19 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":9300
 *         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":9301
 *             indexer[i] = j
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *                 indexer[i] = j
 *                 i += 1
 */
      while (1) {
        __pyx_t_14 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_14) {
        } else {
          __pyx_t_12 = __pyx_t_14;
          goto __pyx_L14_bool_binop_done;
        }
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0);
        __pyx_t_12 = __pyx_t_14;
        __pyx_L14_bool_binop_done:;
        if (!__pyx_t_12) break;

        /* "pandas/src/generated.pyx":9302
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j             # <<<<<<<<<<<<<<
 *                 i += 1
 *             j += 1
 */
        __pyx_t_21 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":9303
 *             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":9304
 *                 indexer[i] = j
 *                 i += 1
 *             j += 1             # <<<<<<<<<<<<<<
 *         elif left[i] > rval:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L11;
    }

    /* "pandas/src/generated.pyx":9305
 *                 i += 1
 *             j += 1
 *         elif left[i] > rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = -1
 *             j += 1
 */
    __pyx_t_22 = __pyx_v_i;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides)) > __pyx_v_rval) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":9306
 *             j += 1
 *         elif left[i] > rval:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             j += 1
 *         else:
 */
      __pyx_t_23 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":9307
 *         elif left[i] > rval:
 *             indexer[i] = -1
 *             j += 1             # <<<<<<<<<<<<<<
 *         else:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":9309
 *             j += 1
 *         else:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             i += 1
 *     return indexer
 */
      __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":9310
 *         else:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *     return indexer
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }
    __pyx_L11:;
    __pyx_L3_continue:;
  }
  __pyx_L4_break:;

  /* "pandas/src/generated.pyx":9311
 *             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":9270
 * @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":9315
 * @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_495left_join_indexer_unique_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_495left_join_indexer_unique_float32 = {"left_join_indexer_unique_float32", (PyCFunction)__pyx_pw_6pandas_5algos_495left_join_indexer_unique_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_495left_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 = 9315; __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 = 9315; __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 = 9315; __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 = 9315; __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 = 9316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_494left_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_494left_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;
  int __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("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 = 9315; __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 = 9315; __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":9322
 *         float32_t lval, rval
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     nleft = len(left)
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":9323
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     nleft = len(left)
 *     nright = len(right)
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":9324
 *     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 = 9324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":9325
 *     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 = 9325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":9327
 *     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 = 9327; __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 = 9327; __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 = 9327; __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 = 9327; __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 = 9327; __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 = 9327; __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 = 9327; __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 = 9327; __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 = 9327; __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 = 9327; __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 = 9327; __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":9328
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)
 *     while True:             # <<<<<<<<<<<<<<
 *         if i == nleft:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":9329
 *     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":9330
 *     while True:
 *         if i == nleft:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if j == nright:
 */
      goto __pyx_L4_break;
    }

    /* "pandas/src/generated.pyx":9332
 *             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":9333
 * 
 *         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":9334
 *         if j == nright:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "pandas/src/generated.pyx":9335
 *             indexer[i] = -1
 *             i += 1
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         rval = right[j]
 */
      goto __pyx_L3_continue;
    }

    /* "pandas/src/generated.pyx":9337
 *             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":9339
 *         rval = right[j]
 * 
 *         while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    while (1) {
      __pyx_t_14 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
      if (__pyx_t_14) {
      } else {
        __pyx_t_12 = __pyx_t_14;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0);
      __pyx_t_12 = __pyx_t_14;
      __pyx_L9_bool_binop_done:;
      if (!__pyx_t_12) break;

      /* "pandas/src/generated.pyx":9340
 * 
 *         while i < nleft - 1 and left[i] == rval:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 * 
 */
      __pyx_t_16 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":9341
 *         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":9343
 *             i += 1
 * 
 *         if left[i] == right[j]:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_t_18 = __pyx_v_j;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_left.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":9344
 * 
 *         if left[i] == right[j]:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 */
      __pyx_t_19 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":9345
 *         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":9346
 *             indexer[i] = j
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *                 indexer[i] = j
 *                 i += 1
 */
      while (1) {
        __pyx_t_14 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_14) {
        } else {
          __pyx_t_12 = __pyx_t_14;
          goto __pyx_L14_bool_binop_done;
        }
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0);
        __pyx_t_12 = __pyx_t_14;
        __pyx_L14_bool_binop_done:;
        if (!__pyx_t_12) break;

        /* "pandas/src/generated.pyx":9347
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j             # <<<<<<<<<<<<<<
 *                 i += 1
 *             j += 1
 */
        __pyx_t_21 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":9348
 *             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":9349
 *                 indexer[i] = j
 *                 i += 1
 *             j += 1             # <<<<<<<<<<<<<<
 *         elif left[i] > rval:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L11;
    }

    /* "pandas/src/generated.pyx":9350
 *                 i += 1
 *             j += 1
 *         elif left[i] > rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = -1
 *             j += 1
 */
    __pyx_t_22 = __pyx_v_i;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides)) > __pyx_v_rval) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":9351
 *             j += 1
 *         elif left[i] > rval:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             j += 1
 *         else:
 */
      __pyx_t_23 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":9352
 *         elif left[i] > rval:
 *             indexer[i] = -1
 *             j += 1             # <<<<<<<<<<<<<<
 *         else:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":9354
 *             j += 1
 *         else:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             i += 1
 *     return indexer
 */
      __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":9355
 *         else:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *     return indexer
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }
    __pyx_L11:;
    __pyx_L3_continue:;
  }
  __pyx_L4_break:;

  /* "pandas/src/generated.pyx":9356
 *             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":9315
 * @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":9360
 * @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_497left_join_indexer_unique_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_497left_join_indexer_unique_object = {"left_join_indexer_unique_object", (PyCFunction)__pyx_pw_6pandas_5algos_497left_join_indexer_unique_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_497left_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 = 9360; __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 = 9360; __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 = 9360; __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 = 9360; __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 = 9361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_496left_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_496left_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;
  int __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("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 = 9360; __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 = 9360; __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":9367
 *         object lval, rval
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     nleft = len(left)
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":9368
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     nleft = len(left)
 *     nright = len(right)
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":9369
 *     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 = 9369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":9370
 *     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 = 9370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":9372
 *     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 = 9372; __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 = 9372; __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 = 9372; __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 = 9372; __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 = 9372; __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 = 9372; __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 = 9372; __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 = 9372; __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 = 9372; __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 = 9372; __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 = 9372; __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":9373
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)
 *     while True:             # <<<<<<<<<<<<<<
 *         if i == nleft:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":9374
 *     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":9375
 *     while True:
 *         if i == nleft:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if j == nright:
 */
      goto __pyx_L4_break;
    }

    /* "pandas/src/generated.pyx":9377
 *             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":9378
 * 
 *         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":9379
 *         if j == nright:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "pandas/src/generated.pyx":9380
 *             indexer[i] = -1
 *             i += 1
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         rval = right[j]
 */
      goto __pyx_L3_continue;
    }

    /* "pandas/src/generated.pyx":9382
 *             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":9384
 *         rval = right[j]
 * 
 *         while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    while (1) {
      __pyx_t_14 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
      if (__pyx_t_14) {
      } else {
        __pyx_t_12 = __pyx_t_14;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_15, __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 = 9384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_12 = __pyx_t_14;
      __pyx_L9_bool_binop_done:;
      if (!__pyx_t_12) break;

      /* "pandas/src/generated.pyx":9385
 * 
 *         while i < nleft - 1 and left[i] == rval:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 * 
 */
      __pyx_t_16 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":9386
 *         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":9388
 *             i += 1
 * 
 *         if left[i] == right[j]:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_left.diminfo[0].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_2);
    __pyx_t_18 = __pyx_v_j;
    __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_18, __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 = 9388; __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_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":9389
 * 
 *         if left[i] == right[j]:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 */
      __pyx_t_19 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":9390
 *         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":9391
 *             indexer[i] = j
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *                 indexer[i] = j
 *                 i += 1
 */
      while (1) {
        __pyx_t_14 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_14) {
        } else {
          __pyx_t_12 = __pyx_t_14;
          goto __pyx_L14_bool_binop_done;
        }
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __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 = 9391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_12 = __pyx_t_14;
        __pyx_L14_bool_binop_done:;
        if (!__pyx_t_12) break;

        /* "pandas/src/generated.pyx":9392
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j             # <<<<<<<<<<<<<<
 *                 i += 1
 *             j += 1
 */
        __pyx_t_21 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":9393
 *             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":9394
 *                 indexer[i] = j
 *                 i += 1
 *             j += 1             # <<<<<<<<<<<<<<
 *         elif left[i] > rval:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L11;
    }

    /* "pandas/src/generated.pyx":9395
 *                 i += 1
 *             j += 1
 *         elif left[i] > rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = -1
 *             j += 1
 */
    __pyx_t_22 = __pyx_v_i;
    __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __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 = 9395; __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 = 9395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":9396
 *             j += 1
 *         elif left[i] > rval:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             j += 1
 *         else:
 */
      __pyx_t_23 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":9397
 *         elif left[i] > rval:
 *             indexer[i] = -1
 *             j += 1             # <<<<<<<<<<<<<<
 *         else:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":9399
 *             j += 1
 *         else:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             i += 1
 *     return indexer
 */
      __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":9400
 *         else:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *     return indexer
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }
    __pyx_L11:;
    __pyx_L3_continue:;
  }
  __pyx_L4_break:;

  /* "pandas/src/generated.pyx":9401
 *             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":9360
 * @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":9405
 * @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_499left_join_indexer_unique_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_499left_join_indexer_unique_int32 = {"left_join_indexer_unique_int32", (PyCFunction)__pyx_pw_6pandas_5algos_499left_join_indexer_unique_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_499left_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 = 9405; __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 = 9405; __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 = 9405; __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 = 9405; __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 = 9406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_498left_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_498left_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;
  int __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("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 = 9405; __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 = 9405; __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":9412
 *         int32_t lval, rval
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     nleft = len(left)
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":9413
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     nleft = len(left)
 *     nright = len(right)
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":9414
 *     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 = 9414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":9415
 *     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 = 9415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":9417
 *     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 = 9417; __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 = 9417; __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 = 9417; __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 = 9417; __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 = 9417; __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 = 9417; __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 = 9417; __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 = 9417; __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 = 9417; __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 = 9417; __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 = 9417; __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":9418
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)
 *     while True:             # <<<<<<<<<<<<<<
 *         if i == nleft:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":9419
 *     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":9420
 *     while True:
 *         if i == nleft:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if j == nright:
 */
      goto __pyx_L4_break;
    }

    /* "pandas/src/generated.pyx":9422
 *             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":9423
 * 
 *         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":9424
 *         if j == nright:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "pandas/src/generated.pyx":9425
 *             indexer[i] = -1
 *             i += 1
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         rval = right[j]
 */
      goto __pyx_L3_continue;
    }

    /* "pandas/src/generated.pyx":9427
 *             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":9429
 *         rval = right[j]
 * 
 *         while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    while (1) {
      __pyx_t_14 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
      if (__pyx_t_14) {
      } else {
        __pyx_t_12 = __pyx_t_14;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0);
      __pyx_t_12 = __pyx_t_14;
      __pyx_L9_bool_binop_done:;
      if (!__pyx_t_12) break;

      /* "pandas/src/generated.pyx":9430
 * 
 *         while i < nleft - 1 and left[i] == rval:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 * 
 */
      __pyx_t_16 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":9431
 *         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":9433
 *             i += 1
 * 
 *         if left[i] == right[j]:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_t_18 = __pyx_v_j;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_left.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":9434
 * 
 *         if left[i] == right[j]:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 */
      __pyx_t_19 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":9435
 *         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":9436
 *             indexer[i] = j
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *                 indexer[i] = j
 *                 i += 1
 */
      while (1) {
        __pyx_t_14 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_14) {
        } else {
          __pyx_t_12 = __pyx_t_14;
          goto __pyx_L14_bool_binop_done;
        }
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0);
        __pyx_t_12 = __pyx_t_14;
        __pyx_L14_bool_binop_done:;
        if (!__pyx_t_12) break;

        /* "pandas/src/generated.pyx":9437
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j             # <<<<<<<<<<<<<<
 *                 i += 1
 *             j += 1
 */
        __pyx_t_21 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":9438
 *             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":9439
 *                 indexer[i] = j
 *                 i += 1
 *             j += 1             # <<<<<<<<<<<<<<
 *         elif left[i] > rval:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L11;
    }

    /* "pandas/src/generated.pyx":9440
 *                 i += 1
 *             j += 1
 *         elif left[i] > rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = -1
 *             j += 1
 */
    __pyx_t_22 = __pyx_v_i;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides)) > __pyx_v_rval) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":9441
 *             j += 1
 *         elif left[i] > rval:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             j += 1
 *         else:
 */
      __pyx_t_23 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":9442
 *         elif left[i] > rval:
 *             indexer[i] = -1
 *             j += 1             # <<<<<<<<<<<<<<
 *         else:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":9444
 *             j += 1
 *         else:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             i += 1
 *     return indexer
 */
      __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":9445
 *         else:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *     return indexer
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }
    __pyx_L11:;
    __pyx_L3_continue:;
  }
  __pyx_L4_break:;

  /* "pandas/src/generated.pyx":9446
 *             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":9405
 * @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":9450
 * @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_501left_join_indexer_unique_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_501left_join_indexer_unique_int64 = {"left_join_indexer_unique_int64", (PyCFunction)__pyx_pw_6pandas_5algos_501left_join_indexer_unique_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_501left_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 = 9450; __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 = 9450; __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 = 9450; __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 = 9450; __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 = 9451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_500left_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_500left_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;
  int __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("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 = 9450; __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 = 9450; __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":9457
 *         int64_t lval, rval
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     nleft = len(left)
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":9458
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     nleft = len(left)
 *     nright = len(right)
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":9459
 *     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 = 9459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":9460
 *     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 = 9460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":9462
 *     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 = 9462; __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 = 9462; __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 = 9462; __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 = 9462; __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 = 9462; __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 = 9462; __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 = 9462; __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 = 9462; __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 = 9462; __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 = 9462; __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 = 9462; __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":9463
 * 
 *     indexer = np.empty(nleft, dtype=np.int64)
 *     while True:             # <<<<<<<<<<<<<<
 *         if i == nleft:
 *             break
 */
  while (1) {

    /* "pandas/src/generated.pyx":9464
 *     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":9465
 *     while True:
 *         if i == nleft:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if j == nright:
 */
      goto __pyx_L4_break;
    }

    /* "pandas/src/generated.pyx":9467
 *             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":9468
 * 
 *         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":9469
 *         if j == nright:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "pandas/src/generated.pyx":9470
 *             indexer[i] = -1
 *             i += 1
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         rval = right[j]
 */
      goto __pyx_L3_continue;
    }

    /* "pandas/src/generated.pyx":9472
 *             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":9474
 *         rval = right[j]
 * 
 *         while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    while (1) {
      __pyx_t_14 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
      if (__pyx_t_14) {
      } else {
        __pyx_t_12 = __pyx_t_14;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0);
      __pyx_t_12 = __pyx_t_14;
      __pyx_L9_bool_binop_done:;
      if (!__pyx_t_12) break;

      /* "pandas/src/generated.pyx":9475
 * 
 *         while i < nleft - 1 and left[i] == rval:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 * 
 */
      __pyx_t_16 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":9476
 *         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":9478
 *             i += 1
 * 
 *         if left[i] == right[j]:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             i += 1
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_t_18 = __pyx_v_j;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_left.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":9479
 * 
 *         if left[i] == right[j]:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 */
      __pyx_t_19 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":9480
 *         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":9481
 *             indexer[i] = j
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:             # <<<<<<<<<<<<<<
 *                 indexer[i] = j
 *                 i += 1
 */
      while (1) {
        __pyx_t_14 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0);
        if (__pyx_t_14) {
        } else {
          __pyx_t_12 = __pyx_t_14;
          goto __pyx_L14_bool_binop_done;
        }
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0);
        __pyx_t_12 = __pyx_t_14;
        __pyx_L14_bool_binop_done:;
        if (!__pyx_t_12) break;

        /* "pandas/src/generated.pyx":9482
 *             i += 1
 *             while i < nleft - 1 and left[i] == rval:
 *                 indexer[i] = j             # <<<<<<<<<<<<<<
 *                 i += 1
 *             j += 1
 */
        __pyx_t_21 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":9483
 *             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":9484
 *                 indexer[i] = j
 *                 i += 1
 *             j += 1             # <<<<<<<<<<<<<<
 *         elif left[i] > rval:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L11;
    }

    /* "pandas/src/generated.pyx":9485
 *                 i += 1
 *             j += 1
 *         elif left[i] > rval:             # <<<<<<<<<<<<<<
 *             indexer[i] = -1
 *             j += 1
 */
    __pyx_t_22 = __pyx_v_i;
    __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides)) > __pyx_v_rval) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/generated.pyx":9486
 *             j += 1
 *         elif left[i] > rval:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             j += 1
 *         else:
 */
      __pyx_t_23 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":9487
 *         elif left[i] > rval:
 *             indexer[i] = -1
 *             j += 1             # <<<<<<<<<<<<<<
 *         else:
 *             indexer[i] = -1
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/src/generated.pyx":9489
 *             j += 1
 *         else:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 *             i += 1
 *     return indexer
 */
      __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":9490
 *         else:
 *             indexer[i] = -1
 *             i += 1             # <<<<<<<<<<<<<<
 *     return indexer
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }
    __pyx_L11:;
    __pyx_L3_continue:;
  }
  __pyx_L4_break:;

  /* "pandas/src/generated.pyx":9491
 *             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":9450
 * @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":9495
 * 
 * 
 * def left_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float64_t] right):
 *     '''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_503left_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_502left_join_indexer_float64[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_503left_join_indexer_float64 = {"left_join_indexer_float64", (PyCFunction)__pyx_pw_6pandas_5algos_503left_join_indexer_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_502left_join_indexer_float64};
static PyObject *__pyx_pw_6pandas_5algos_503left_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 = 9495; __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 = 9495; __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 = 9495; __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 = 9495; __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 = 9496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_502left_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_502left_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;
  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 = 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;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  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("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 = 9495; __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 = 9495; __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":9506
 *         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 = 9506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":9507
 * 
 *     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 = 9507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":9509
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":9510
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":9511
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":9512
 *     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":9513
 *     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":9514
 *     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":9515
 *         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":9516
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":9518
 *                 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 = 9518; __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":9519
 * 
 *             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 = 9519; __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":9521
 *             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":9522
 * 
 *             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":9523
 *             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":9524
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_5) {
          } else {
            __pyx_t_2 = __pyx_t_5;
            goto __pyx_L10_bool_binop_done;
          }
          __pyx_t_6 = (__pyx_v_j + 1);
          __pyx_t_3 = -1;
          if (__pyx_t_6 < 0) {
            __pyx_t_6 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_6 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_6 >= __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 = 9524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_5 = (((*__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_2 = __pyx_t_5;
          __pyx_L10_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":9525
 *                 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":9527
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":9528
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_7 = __pyx_v_i;
            __pyx_t_3 = -1;
            if (__pyx_t_7 < 0) {
              __pyx_t_7 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_7 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_7 >= __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 = 9528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_2 = (((*__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_2) {

              /* "pandas/src/generated.pyx":9529
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L12;
            }
            __pyx_L12:;
          }
          __pyx_L9:;
          goto __pyx_L8;
        }

        /* "pandas/src/generated.pyx":9530
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":9531
 *                             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":9532
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_8 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_8 < 0) {
            __pyx_t_8 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_8 >= __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 = 9532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_2 = ((__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_2) {

            /* "pandas/src/generated.pyx":9533
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L13;
          }
          __pyx_L13:;
          goto __pyx_L8;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":9536
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L8:;
        goto __pyx_L7;
      }

      /* "pandas/src/generated.pyx":9537
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":9538
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":9539
 *             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":9541
 *                 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":9545
 *     # 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 = 9545; __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 = 9545; __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 = 9545; __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 = 9545; __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 = 9545; __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 = 9545; __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 = 9545; __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 = 9545; __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 = 9545; __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 = 9545; __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_3 = __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_3 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      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_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_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 = 9545; __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":9546
 * 
 *     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 = 9546; __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 = 9546; __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 = 9546; __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 = 9546; __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 = 9546; __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 = 9546; __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 = 9546; __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 = 9546; __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 = 9546; __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 = 9546; __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_3 = __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_3 < 0)) {
      PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
      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_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      }
    }
    __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 = 9546; __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":9547
 *     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 = 9547; __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 = 9547; __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 = 9547; __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 = 9547; __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 = 9547; __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 = 9547; __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 = 9547; __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 = 9547; __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 = 9547; __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 = 9547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_10);
  {
    __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_18, &__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_15, &__pyx_t_16, &__pyx_t_17);
      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_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_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 = 9547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_18 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "pandas/src/generated.pyx":9549
 *     result = np.empty(count, dtype=np.float64)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":9550
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":9551
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":9552
 *     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":9553
 *     count = 0
 *     if nleft > 0:
 *         while i < nleft:             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
    while (1) {
      __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
      if (!__pyx_t_2) break;

      /* "pandas/src/generated.pyx":9554
 *     if nleft > 0:
 *         while i < nleft:
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":9555
 *         while i < nleft:
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_2) break;

          /* "pandas/src/generated.pyx":9556
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_19 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_19 < 0) {
            __pyx_t_19 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_19 >= __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 = 9556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":9557
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     i += 1
 */
          __pyx_t_20 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_20 < 0) {
            __pyx_t_20 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_20 >= __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 = 9557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":9558
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     i += 1
 *                     count += 1
 */
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_3 = -1;
          if (__pyx_t_21 < 0) {
            __pyx_t_21 += __pyx_pybuffernd_left.diminfo[0].shape;
            if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_21 >= __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 = 9558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_22 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_22 < 0) {
            __pyx_t_22 += __pyx_pybuffernd_result.diminfo[0].shape;
            if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_22 >= __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 = 9558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides));

          /* "pandas/src/generated.pyx":9559
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     i += 1             # <<<<<<<<<<<<<<
 *                     count += 1
 *                 break
 */
          __pyx_v_i = (__pyx_v_i + 1);

          /* "pandas/src/generated.pyx":9560
 *                     result[count] = left[i]
 *                     i += 1
 *                     count += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_count = (__pyx_v_count + 1);
        }

        /* "pandas/src/generated.pyx":9561
 *                     i += 1
 *                     count += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L16_break;
      }

      /* "pandas/src/generated.pyx":9563
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_23 < 0) {
        __pyx_t_23 += __pyx_pybuffernd_left.diminfo[0].shape;
        if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_23 >= __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 = 9563; __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_23, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":9564
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_24 = __pyx_v_j;
      __pyx_t_3 = -1;
      if (__pyx_t_24 < 0) {
        __pyx_t_24 += __pyx_pybuffernd_right.diminfo[0].shape;
        if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_24 >= __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 = 9564; __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_24, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":9566
 *             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":9567
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_25 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_25 < 0) {
          __pyx_t_25 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_25 >= __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 = 9567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":9568
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_26 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_26 < 0) {
          __pyx_t_26 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_26 >= __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 = 9568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":9569
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_27 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_27 < 0) {
          __pyx_t_27 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_27 >= __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 = 9569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":9570
 *                 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":9571
 *                 result[count] = lval
 *                 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":9572
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_5) {
          } else {
            __pyx_t_2 = __pyx_t_5;
            goto __pyx_L23_bool_binop_done;
          }
          __pyx_t_28 = (__pyx_v_j + 1);
          __pyx_t_3 = -1;
          if (__pyx_t_28 < 0) {
            __pyx_t_28 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_28 >= __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 = 9572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
          __pyx_t_2 = __pyx_t_5;
          __pyx_L23_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":9573
 *                 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_L22;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":9575
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":9576
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_29 = __pyx_v_i;
            __pyx_t_3 = -1;
            if (__pyx_t_29 < 0) {
              __pyx_t_29 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_29 >= __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 = 9576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":9577
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L25;
            }
            __pyx_L25:;
          }
          __pyx_L22:;
          goto __pyx_L21;
        }

        /* "pandas/src/generated.pyx":9578
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":9579
 *                             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":9580
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_30 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_30 < 0) {
            __pyx_t_30 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_30 >= __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 = 9580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":9581
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L26;
          }
          __pyx_L26:;
          goto __pyx_L21;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":9584
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L16_break;
        }
        __pyx_L21:;
        goto __pyx_L20;
      }

      /* "pandas/src/generated.pyx":9585
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":9586
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 */
        __pyx_t_31 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_31 < 0) {
          __pyx_t_31 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_31 >= __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 = 9586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":9587
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = left[i]
 *                 count += 1
 */
        __pyx_t_32 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_32 < 0) {
          __pyx_t_32 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_32 >= __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 = 9587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":9588
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = left[i]             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_33 = __pyx_v_i;
        __pyx_t_3 = -1;
        if (__pyx_t_33 < 0) {
          __pyx_t_33 += __pyx_pybuffernd_left.diminfo[0].shape;
          if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_33 >= __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 = 9588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_34 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_34 < 0) {
          __pyx_t_34 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_34 >= __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 = 9588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_left.diminfo[0].strides));

        /* "pandas/src/generated.pyx":9589
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":9590
 *                 result[count] = left[i]
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L20;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":9592
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L20:;
    }
    __pyx_L16_break:;
    goto __pyx_L14;
  }
  __pyx_L14:;

  /* "pandas/src/generated.pyx":9594
 *                 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 = 9594; __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":9495
 * 
 * 
 * def left_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.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":9597
 * 
 * 
 * def left_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float32_t] right):
 *     '''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_505left_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_504left_join_indexer_float32[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_505left_join_indexer_float32 = {"left_join_indexer_float32", (PyCFunction)__pyx_pw_6pandas_5algos_505left_join_indexer_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_504left_join_indexer_float32};
static PyObject *__pyx_pw_6pandas_5algos_505left_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 = 9597; __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 = 9597; __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 = 9597; __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 = 9597; __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 = 9598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_504left_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_504left_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;
  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 = 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;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  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("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 = 9597; __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 = 9597; __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":9608
 *         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 = 9608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":9609
 * 
 *     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 = 9609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":9611
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":9612
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":9613
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":9614
 *     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":9615
 *     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":9616
 *     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":9617
 *         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":9618
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":9620
 *                 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 = 9620; __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":9621
 * 
 *             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 = 9621; __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":9623
 *             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":9624
 * 
 *             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":9625
 *             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":9626
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_5) {
          } else {
            __pyx_t_2 = __pyx_t_5;
            goto __pyx_L10_bool_binop_done;
          }
          __pyx_t_6 = (__pyx_v_j + 1);
          __pyx_t_3 = -1;
          if (__pyx_t_6 < 0) {
            __pyx_t_6 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_6 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_6 >= __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 = 9626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_5 = (((*__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_2 = __pyx_t_5;
          __pyx_L10_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":9627
 *                 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":9629
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":9630
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_7 = __pyx_v_i;
            __pyx_t_3 = -1;
            if (__pyx_t_7 < 0) {
              __pyx_t_7 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_7 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_7 >= __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 = 9630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_2 = (((*__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_2) {

              /* "pandas/src/generated.pyx":9631
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L12;
            }
            __pyx_L12:;
          }
          __pyx_L9:;
          goto __pyx_L8;
        }

        /* "pandas/src/generated.pyx":9632
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":9633
 *                             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":9634
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_8 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_8 < 0) {
            __pyx_t_8 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_8 >= __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 = 9634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_2 = ((__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_2) {

            /* "pandas/src/generated.pyx":9635
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L13;
          }
          __pyx_L13:;
          goto __pyx_L8;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":9638
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L8:;
        goto __pyx_L7;
      }

      /* "pandas/src/generated.pyx":9639
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":9640
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":9641
 *             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":9643
 *                 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":9647
 *     # 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 = 9647; __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 = 9647; __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 = 9647; __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 = 9647; __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 = 9647; __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 = 9647; __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 = 9647; __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 = 9647; __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 = 9647; __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 = 9647; __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_3 = __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_3 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      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_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_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 = 9647; __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":9648
 * 
 *     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 = 9648; __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 = 9648; __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 = 9648; __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 = 9648; __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 = 9648; __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 = 9648; __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 = 9648; __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 = 9648; __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 = 9648; __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 = 9648; __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_3 = __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_3 < 0)) {
      PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
      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_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      }
    }
    __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 = 9648; __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":9649
 *     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 = 9649; __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 = 9649; __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 = 9649; __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 = 9649; __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 = 9649; __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 = 9649; __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 = 9649; __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 = 9649; __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 = 9649; __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 = 9649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_10);
  {
    __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_18, &__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_15, &__pyx_t_16, &__pyx_t_17);
      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_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_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 = 9649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_18 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "pandas/src/generated.pyx":9651
 *     result = np.empty(count, dtype=np.float32)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":9652
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":9653
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":9654
 *     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":9655
 *     count = 0
 *     if nleft > 0:
 *         while i < nleft:             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
    while (1) {
      __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
      if (!__pyx_t_2) break;

      /* "pandas/src/generated.pyx":9656
 *     if nleft > 0:
 *         while i < nleft:
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":9657
 *         while i < nleft:
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_2) break;

          /* "pandas/src/generated.pyx":9658
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_19 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_19 < 0) {
            __pyx_t_19 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_19 >= __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 = 9658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":9659
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     i += 1
 */
          __pyx_t_20 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_20 < 0) {
            __pyx_t_20 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_20 >= __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 = 9659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":9660
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     i += 1
 *                     count += 1
 */
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_3 = -1;
          if (__pyx_t_21 < 0) {
            __pyx_t_21 += __pyx_pybuffernd_left.diminfo[0].shape;
            if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_21 >= __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 = 9660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_22 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_22 < 0) {
            __pyx_t_22 += __pyx_pybuffernd_result.diminfo[0].shape;
            if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_22 >= __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 = 9660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides));

          /* "pandas/src/generated.pyx":9661
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     i += 1             # <<<<<<<<<<<<<<
 *                     count += 1
 *                 break
 */
          __pyx_v_i = (__pyx_v_i + 1);

          /* "pandas/src/generated.pyx":9662
 *                     result[count] = left[i]
 *                     i += 1
 *                     count += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_count = (__pyx_v_count + 1);
        }

        /* "pandas/src/generated.pyx":9663
 *                     i += 1
 *                     count += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L16_break;
      }

      /* "pandas/src/generated.pyx":9665
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_23 < 0) {
        __pyx_t_23 += __pyx_pybuffernd_left.diminfo[0].shape;
        if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_23 >= __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 = 9665; __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_23, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":9666
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_24 = __pyx_v_j;
      __pyx_t_3 = -1;
      if (__pyx_t_24 < 0) {
        __pyx_t_24 += __pyx_pybuffernd_right.diminfo[0].shape;
        if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_24 >= __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 = 9666; __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_24, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":9668
 *             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":9669
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_25 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_25 < 0) {
          __pyx_t_25 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_25 >= __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 = 9669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":9670
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_26 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_26 < 0) {
          __pyx_t_26 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_26 >= __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 = 9670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":9671
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_27 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_27 < 0) {
          __pyx_t_27 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_27 >= __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 = 9671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":9672
 *                 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":9673
 *                 result[count] = lval
 *                 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":9674
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_5) {
          } else {
            __pyx_t_2 = __pyx_t_5;
            goto __pyx_L23_bool_binop_done;
          }
          __pyx_t_28 = (__pyx_v_j + 1);
          __pyx_t_3 = -1;
          if (__pyx_t_28 < 0) {
            __pyx_t_28 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_28 >= __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 = 9674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
          __pyx_t_2 = __pyx_t_5;
          __pyx_L23_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":9675
 *                 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_L22;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":9677
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":9678
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_29 = __pyx_v_i;
            __pyx_t_3 = -1;
            if (__pyx_t_29 < 0) {
              __pyx_t_29 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_29 >= __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 = 9678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":9679
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L25;
            }
            __pyx_L25:;
          }
          __pyx_L22:;
          goto __pyx_L21;
        }

        /* "pandas/src/generated.pyx":9680
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":9681
 *                             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":9682
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_30 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_30 < 0) {
            __pyx_t_30 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_30 >= __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 = 9682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":9683
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L26;
          }
          __pyx_L26:;
          goto __pyx_L21;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":9686
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L16_break;
        }
        __pyx_L21:;
        goto __pyx_L20;
      }

      /* "pandas/src/generated.pyx":9687
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":9688
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 */
        __pyx_t_31 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_31 < 0) {
          __pyx_t_31 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_31 >= __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 = 9688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":9689
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = left[i]
 *                 count += 1
 */
        __pyx_t_32 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_32 < 0) {
          __pyx_t_32 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_32 >= __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 = 9689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":9690
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = left[i]             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_33 = __pyx_v_i;
        __pyx_t_3 = -1;
        if (__pyx_t_33 < 0) {
          __pyx_t_33 += __pyx_pybuffernd_left.diminfo[0].shape;
          if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_33 >= __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 = 9690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_34 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_34 < 0) {
          __pyx_t_34 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_34 >= __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 = 9690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_left.diminfo[0].strides));

        /* "pandas/src/generated.pyx":9691
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":9692
 *                 result[count] = left[i]
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L20;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":9694
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L20:;
    }
    __pyx_L16_break:;
    goto __pyx_L14;
  }
  __pyx_L14:;

  /* "pandas/src/generated.pyx":9696
 *                 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 = 9696; __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":9597
 * 
 * 
 * def left_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.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":9699
 * 
 * 
 * def left_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                               ndarray[object] right):
 *     '''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_507left_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_506left_join_indexer_object[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_507left_join_indexer_object = {"left_join_indexer_object", (PyCFunction)__pyx_pw_6pandas_5algos_507left_join_indexer_object, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_506left_join_indexer_object};
static PyObject *__pyx_pw_6pandas_5algos_507left_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 = 9699; __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 = 9699; __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 = 9699; __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 = 9699; __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 = 9700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_506left_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_506left_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;
  int __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;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  PyObject **__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_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 = 9699; __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 = 9699; __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":9710
 *         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 = 9710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":9711
 * 
 *     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 = 9711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":9713
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":9714
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":9715
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":9716
 *     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":9717
 *     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":9718
 *     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":9719
 *         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":9720
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":9722
 *                 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 = 9722; __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":9723
 * 
 *             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 = 9723; __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":9725
 *             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 = 9725; __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 = 9725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":9726
 * 
 *             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":9727
 *             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":9728
 *                 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) {
          } else {
            __pyx_t_2 = __pyx_t_6;
            goto __pyx_L10_bool_binop_done;
          }
          __pyx_t_7 = (__pyx_v_j + 1);
          __pyx_t_4 = -1;
          if (__pyx_t_7 < 0) {
            __pyx_t_7 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_7 < 0)) __pyx_t_4 = 0;
          } else if (unlikely(__pyx_t_7 >= __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 = 9728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_right.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_3);
          __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_2 = __pyx_t_6;
          __pyx_L10_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":9729
 *                 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":9731
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":9732
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_9 = __pyx_v_i;
            __pyx_t_4 = -1;
            if (__pyx_t_9 < 0) {
              __pyx_t_9 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_9 < 0)) __pyx_t_4 = 0;
            } else if (unlikely(__pyx_t_9 >= __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 = 9732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __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_3 = PyObject_RichCompare(__pyx_t_8, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":9733
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L12;
            }
            __pyx_L12:;
          }
          __pyx_L9:;
          goto __pyx_L8;
        }

        /* "pandas/src/generated.pyx":9734
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":9735
 *                             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":9736
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_10 = __pyx_v_j;
          __pyx_t_4 = -1;
          if (__pyx_t_10 < 0) {
            __pyx_t_10 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_10 < 0)) __pyx_t_4 = 0;
          } else if (unlikely(__pyx_t_10 >= __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 = 9736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __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_8 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":9737
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L13;
          }
          __pyx_L13:;
          goto __pyx_L8;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":9740
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L8:;
        goto __pyx_L7;
      }

      /* "pandas/src/generated.pyx":9741
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __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 = 9741; __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 = 9741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":9742
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":9743
 *             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":9745
 *                 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":9749
 *     # 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 = 9749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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 = 9749; __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 = 9749; __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 = 9749; __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 = 9749; __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 = 9749; __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 = 9749; __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_8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9749; __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_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 = 9749; __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_4 = __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_4 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      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_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_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 = 9749; __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":9750
 * 
 *     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 = 9750; __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 = 9750; __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 = 9750; __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 = 9750; __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 = 9750; __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 = 9750; __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 = 9750; __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 = 9750; __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 = 9750; __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 = 9750; __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_4 = __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_4 < 0)) {
      PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
      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_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      }
    }
    __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 = 9750; __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":9751
 *     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 = 9751; __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 = 9751; __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 = 9751; __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 = 9751; __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 = 9751; __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 = 9751; __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 = 9751; __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 = 9751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_8);
  {
    __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_18, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_4 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      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_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_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 = 9751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_18 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pandas/src/generated.pyx":9753
 *     result = np.empty(count, dtype=object)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":9754
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":9755
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":9756
 *     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":9757
 *     count = 0
 *     if nleft > 0:
 *         while i < nleft:             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
    while (1) {
      __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
      if (!__pyx_t_2) break;

      /* "pandas/src/generated.pyx":9758
 *     if nleft > 0:
 *         while i < nleft:
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":9759
 *         while i < nleft:
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_2) break;

          /* "pandas/src/generated.pyx":9760
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_19 = __pyx_v_count;
          __pyx_t_4 = -1;
          if (__pyx_t_19 < 0) {
            __pyx_t_19 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_19 < 0)) __pyx_t_4 = 0;
          } else if (unlikely(__pyx_t_19 >= __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 = 9760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":9761
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     i += 1
 */
          __pyx_t_20 = __pyx_v_count;
          __pyx_t_4 = -1;
          if (__pyx_t_20 < 0) {
            __pyx_t_20 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_20 < 0)) __pyx_t_4 = 0;
          } else if (unlikely(__pyx_t_20 >= __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 = 9761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":9762
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     i += 1
 *                     count += 1
 */
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_4 = -1;
          if (__pyx_t_21 < 0) {
            __pyx_t_21 += __pyx_pybuffernd_left.diminfo[0].shape;
            if (unlikely(__pyx_t_21 < 0)) __pyx_t_4 = 0;
          } else if (unlikely(__pyx_t_21 >= __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 = 9762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_8);
          __pyx_t_22 = __pyx_v_count;
          __pyx_t_4 = -1;
          if (__pyx_t_22 < 0) {
            __pyx_t_22 += __pyx_pybuffernd_result.diminfo[0].shape;
            if (unlikely(__pyx_t_22 < 0)) __pyx_t_4 = 0;
          } else if (unlikely(__pyx_t_22 >= __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 = 9762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_23 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_result.diminfo[0].strides);
          __Pyx_GOTREF(*__pyx_t_23);
          __Pyx_INCREF(__pyx_t_8); __Pyx_DECREF(*__pyx_t_23);
          *__pyx_t_23 = __pyx_t_8;
          __Pyx_GIVEREF(*__pyx_t_23);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

          /* "pandas/src/generated.pyx":9763
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     i += 1             # <<<<<<<<<<<<<<
 *                     count += 1
 *                 break
 */
          __pyx_v_i = (__pyx_v_i + 1);

          /* "pandas/src/generated.pyx":9764
 *                     result[count] = left[i]
 *                     i += 1
 *                     count += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_count = (__pyx_v_count + 1);
        }

        /* "pandas/src/generated.pyx":9765
 *                     i += 1
 *                     count += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L16_break;
      }

      /* "pandas/src/generated.pyx":9767
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_24 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_24 < 0) {
        __pyx_t_24 += __pyx_pybuffernd_left.diminfo[0].shape;
        if (unlikely(__pyx_t_24 < 0)) __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_24 >= __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 = 9767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_24, __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":9768
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_25 = __pyx_v_j;
      __pyx_t_4 = -1;
      if (__pyx_t_25 < 0) {
        __pyx_t_25 += __pyx_pybuffernd_right.diminfo[0].shape;
        if (unlikely(__pyx_t_25 < 0)) __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_25 >= __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 = 9768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __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":9770
 *             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 = 9770; __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 = 9770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":9771
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_26 = __pyx_v_count;
        __pyx_t_4 = -1;
        if (__pyx_t_26 < 0) {
          __pyx_t_26 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_4 = 0;
        } else if (unlikely(__pyx_t_26 >= __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 = 9771; __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":9772
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_27 = __pyx_v_count;
        __pyx_t_4 = -1;
        if (__pyx_t_27 < 0) {
          __pyx_t_27 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_4 = 0;
        } else if (unlikely(__pyx_t_27 >= __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 = 9772; __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":9773
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_28 = __pyx_v_count;
        __pyx_t_4 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_28 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_28 < 0)) __pyx_t_4 = 0;
        } else if (unlikely(__pyx_t_28 >= __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 = 9773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_23 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides);
        __Pyx_GOTREF(*__pyx_t_23);
        __Pyx_INCREF(__pyx_v_lval); __Pyx_DECREF(*__pyx_t_23);
        *__pyx_t_23 = __pyx_v_lval;
        __Pyx_GIVEREF(*__pyx_t_23);

        /* "pandas/src/generated.pyx":9774
 *                 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":9775
 *                 result[count] = lval
 *                 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":9776
 *                 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) {
          } else {
            __pyx_t_2 = __pyx_t_6;
            goto __pyx_L23_bool_binop_done;
          }
          __pyx_t_29 = (__pyx_v_j + 1);
          __pyx_t_4 = -1;
          if (__pyx_t_29 < 0) {
            __pyx_t_29 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_29 < 0)) __pyx_t_4 = 0;
          } else if (unlikely(__pyx_t_29 >= __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 = 9776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_29, __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 = 9776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_2 = __pyx_t_6;
          __pyx_L23_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":9777
 *                 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_L22;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":9779
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":9780
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_30 = __pyx_v_i;
            __pyx_t_4 = -1;
            if (__pyx_t_30 < 0) {
              __pyx_t_30 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_30 < 0)) __pyx_t_4 = 0;
            } else if (unlikely(__pyx_t_30 >= __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 = 9780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_12 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_30, __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 = 9780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":9781
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L25;
            }
            __pyx_L25:;
          }
          __pyx_L22:;
          goto __pyx_L21;
        }

        /* "pandas/src/generated.pyx":9782
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":9783
 *                             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":9784
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_31 = __pyx_v_j;
          __pyx_t_4 = -1;
          if (__pyx_t_31 < 0) {
            __pyx_t_31 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_31 < 0)) __pyx_t_4 = 0;
          } else if (unlikely(__pyx_t_31 >= __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 = 9784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_31, __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 = 9784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":9785
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L26;
          }
          __pyx_L26:;
          goto __pyx_L21;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":9788
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L16_break;
        }
        __pyx_L21:;
        goto __pyx_L20;
      }

      /* "pandas/src/generated.pyx":9789
 *                     # 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 = 9789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":9790
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 */
        __pyx_t_32 = __pyx_v_count;
        __pyx_t_4 = -1;
        if (__pyx_t_32 < 0) {
          __pyx_t_32 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_32 < 0)) __pyx_t_4 = 0;
        } else if (unlikely(__pyx_t_32 >= __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 = 9790; __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":9791
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = left[i]
 *                 count += 1
 */
        __pyx_t_33 = __pyx_v_count;
        __pyx_t_4 = -1;
        if (__pyx_t_33 < 0) {
          __pyx_t_33 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_33 < 0)) __pyx_t_4 = 0;
        } else if (unlikely(__pyx_t_33 >= __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 = 9791; __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":9792
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = left[i]             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_34 = __pyx_v_i;
        __pyx_t_4 = -1;
        if (__pyx_t_34 < 0) {
          __pyx_t_34 += __pyx_pybuffernd_left.diminfo[0].shape;
          if (unlikely(__pyx_t_34 < 0)) __pyx_t_4 = 0;
        } else if (unlikely(__pyx_t_34 >= __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 = 9792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_12 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides);
        __Pyx_INCREF((PyObject*)__pyx_t_12);
        __pyx_t_35 = __pyx_v_count;
        __pyx_t_4 = -1;
        if (__pyx_t_35 < 0) {
          __pyx_t_35 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_35 < 0)) __pyx_t_4 = 0;
        } else if (unlikely(__pyx_t_35 >= __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 = 9792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_23 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides);
        __Pyx_GOTREF(*__pyx_t_23);
        __Pyx_INCREF(__pyx_t_12); __Pyx_DECREF(*__pyx_t_23);
        *__pyx_t_23 = __pyx_t_12;
        __Pyx_GIVEREF(*__pyx_t_23);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "pandas/src/generated.pyx":9793
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":9794
 *                 result[count] = left[i]
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L20;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":9796
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L20:;
    }
    __pyx_L16_break:;
    goto __pyx_L14;
  }
  __pyx_L14:;

  /* "pandas/src/generated.pyx":9798
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9798; __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":9699
 * 
 * 
 * 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_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.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":9801
 * 
 * 
 * def left_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int32_t] right):
 *     '''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_509left_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_508left_join_indexer_int32[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_509left_join_indexer_int32 = {"left_join_indexer_int32", (PyCFunction)__pyx_pw_6pandas_5algos_509left_join_indexer_int32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_508left_join_indexer_int32};
static PyObject *__pyx_pw_6pandas_5algos_509left_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 = 9801; __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 = 9801; __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 = 9801; __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 = 9801; __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 = 9802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_508left_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_508left_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;
  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 = 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;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  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("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 = 9801; __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 = 9801; __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":9812
 *         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 = 9812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":9813
 * 
 *     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 = 9813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":9815
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":9816
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":9817
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":9818
 *     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":9819
 *     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":9820
 *     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":9821
 *         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":9822
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":9824
 *                 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 = 9824; __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":9825
 * 
 *             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 = 9825; __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":9827
 *             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":9828
 * 
 *             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":9829
 *             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":9830
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_5) {
          } else {
            __pyx_t_2 = __pyx_t_5;
            goto __pyx_L10_bool_binop_done;
          }
          __pyx_t_6 = (__pyx_v_j + 1);
          __pyx_t_3 = -1;
          if (__pyx_t_6 < 0) {
            __pyx_t_6 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_6 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_6 >= __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 = 9830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_5 = (((*__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_2 = __pyx_t_5;
          __pyx_L10_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":9831
 *                 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":9833
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":9834
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_7 = __pyx_v_i;
            __pyx_t_3 = -1;
            if (__pyx_t_7 < 0) {
              __pyx_t_7 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_7 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_7 >= __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 = 9834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_2 = (((*__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_2) {

              /* "pandas/src/generated.pyx":9835
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L12;
            }
            __pyx_L12:;
          }
          __pyx_L9:;
          goto __pyx_L8;
        }

        /* "pandas/src/generated.pyx":9836
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":9837
 *                             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":9838
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_8 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_8 < 0) {
            __pyx_t_8 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_8 >= __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 = 9838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_2 = ((__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_2) {

            /* "pandas/src/generated.pyx":9839
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L13;
          }
          __pyx_L13:;
          goto __pyx_L8;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":9842
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L8:;
        goto __pyx_L7;
      }

      /* "pandas/src/generated.pyx":9843
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":9844
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":9845
 *             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":9847
 *                 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":9851
 *     # 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 = 9851; __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 = 9851; __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 = 9851; __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 = 9851; __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 = 9851; __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 = 9851; __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 = 9851; __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 = 9851; __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 = 9851; __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 = 9851; __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_3 = __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_3 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      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_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_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 = 9851; __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":9852
 * 
 *     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 = 9852; __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 = 9852; __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 = 9852; __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 = 9852; __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 = 9852; __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 = 9852; __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 = 9852; __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 = 9852; __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 = 9852; __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 = 9852; __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_3 = __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_3 < 0)) {
      PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
      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_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      }
    }
    __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 = 9852; __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":9853
 *     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 = 9853; __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 = 9853; __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 = 9853; __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 = 9853; __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 = 9853; __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 = 9853; __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 = 9853; __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 = 9853; __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 = 9853; __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 = 9853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_10);
  {
    __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_18, &__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_15, &__pyx_t_16, &__pyx_t_17);
      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_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_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 = 9853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_18 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "pandas/src/generated.pyx":9855
 *     result = np.empty(count, dtype=np.int32)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":9856
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":9857
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":9858
 *     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":9859
 *     count = 0
 *     if nleft > 0:
 *         while i < nleft:             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
    while (1) {
      __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
      if (!__pyx_t_2) break;

      /* "pandas/src/generated.pyx":9860
 *     if nleft > 0:
 *         while i < nleft:
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":9861
 *         while i < nleft:
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_2) break;

          /* "pandas/src/generated.pyx":9862
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_19 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_19 < 0) {
            __pyx_t_19 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_19 >= __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 = 9862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":9863
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     i += 1
 */
          __pyx_t_20 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_20 < 0) {
            __pyx_t_20 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_20 >= __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 = 9863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":9864
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     i += 1
 *                     count += 1
 */
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_3 = -1;
          if (__pyx_t_21 < 0) {
            __pyx_t_21 += __pyx_pybuffernd_left.diminfo[0].shape;
            if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_21 >= __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 = 9864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_22 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_22 < 0) {
            __pyx_t_22 += __pyx_pybuffernd_result.diminfo[0].shape;
            if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_22 >= __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 = 9864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides));

          /* "pandas/src/generated.pyx":9865
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     i += 1             # <<<<<<<<<<<<<<
 *                     count += 1
 *                 break
 */
          __pyx_v_i = (__pyx_v_i + 1);

          /* "pandas/src/generated.pyx":9866
 *                     result[count] = left[i]
 *                     i += 1
 *                     count += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_count = (__pyx_v_count + 1);
        }

        /* "pandas/src/generated.pyx":9867
 *                     i += 1
 *                     count += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L16_break;
      }

      /* "pandas/src/generated.pyx":9869
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_23 < 0) {
        __pyx_t_23 += __pyx_pybuffernd_left.diminfo[0].shape;
        if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_23 >= __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 = 9869; __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_23, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":9870
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_24 = __pyx_v_j;
      __pyx_t_3 = -1;
      if (__pyx_t_24 < 0) {
        __pyx_t_24 += __pyx_pybuffernd_right.diminfo[0].shape;
        if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_24 >= __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 = 9870; __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_24, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":9872
 *             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":9873
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_25 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_25 < 0) {
          __pyx_t_25 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_25 >= __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 = 9873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":9874
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_26 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_26 < 0) {
          __pyx_t_26 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_26 >= __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 = 9874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":9875
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_27 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_27 < 0) {
          __pyx_t_27 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_27 >= __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 = 9875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":9876
 *                 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":9877
 *                 result[count] = lval
 *                 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":9878
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_5) {
          } else {
            __pyx_t_2 = __pyx_t_5;
            goto __pyx_L23_bool_binop_done;
          }
          __pyx_t_28 = (__pyx_v_j + 1);
          __pyx_t_3 = -1;
          if (__pyx_t_28 < 0) {
            __pyx_t_28 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_28 >= __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 = 9878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
          __pyx_t_2 = __pyx_t_5;
          __pyx_L23_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":9879
 *                 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_L22;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":9881
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":9882
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_29 = __pyx_v_i;
            __pyx_t_3 = -1;
            if (__pyx_t_29 < 0) {
              __pyx_t_29 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_29 >= __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 = 9882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":9883
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L25;
            }
            __pyx_L25:;
          }
          __pyx_L22:;
          goto __pyx_L21;
        }

        /* "pandas/src/generated.pyx":9884
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":9885
 *                             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":9886
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_30 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_30 < 0) {
            __pyx_t_30 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_30 >= __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 = 9886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":9887
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L26;
          }
          __pyx_L26:;
          goto __pyx_L21;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":9890
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L16_break;
        }
        __pyx_L21:;
        goto __pyx_L20;
      }

      /* "pandas/src/generated.pyx":9891
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":9892
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 */
        __pyx_t_31 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_31 < 0) {
          __pyx_t_31 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_31 >= __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 = 9892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":9893
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = left[i]
 *                 count += 1
 */
        __pyx_t_32 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_32 < 0) {
          __pyx_t_32 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_32 >= __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 = 9893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":9894
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = left[i]             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_33 = __pyx_v_i;
        __pyx_t_3 = -1;
        if (__pyx_t_33 < 0) {
          __pyx_t_33 += __pyx_pybuffernd_left.diminfo[0].shape;
          if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_33 >= __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 = 9894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_34 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_34 < 0) {
          __pyx_t_34 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_34 >= __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 = 9894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_left.diminfo[0].strides));

        /* "pandas/src/generated.pyx":9895
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":9896
 *                 result[count] = left[i]
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L20;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":9898
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L20:;
    }
    __pyx_L16_break:;
    goto __pyx_L14;
  }
  __pyx_L14:;

  /* "pandas/src/generated.pyx":9900
 *                 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 = 9900; __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":9801
 * 
 * 
 * def left_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.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":9903
 * 
 * 
 * def left_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] right):
 *     '''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_5algos_511left_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_510left_join_indexer_int64[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_511left_join_indexer_int64 = {"left_join_indexer_int64", (PyCFunction)__pyx_pw_6pandas_5algos_511left_join_indexer_int64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_510left_join_indexer_int64};
static PyObject *__pyx_pw_6pandas_5algos_511left_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 = 9903; __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 = 9903; __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 = 9903; __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 = 9903; __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 = 9904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_510left_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_510left_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;
  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 = 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;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  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("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 = 9903; __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 = 9903; __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":9914
 *         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 = 9914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":9915
 * 
 *     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 = 9915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":9917
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":9918
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":9919
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":9920
 *     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":9921
 *     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":9922
 *     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":9923
 *         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":9924
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":9926
 *                 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 = 9926; __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":9927
 * 
 *             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 = 9927; __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":9929
 *             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":9930
 * 
 *             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":9931
 *             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":9932
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_5) {
          } else {
            __pyx_t_2 = __pyx_t_5;
            goto __pyx_L10_bool_binop_done;
          }
          __pyx_t_6 = (__pyx_v_j + 1);
          __pyx_t_3 = -1;
          if (__pyx_t_6 < 0) {
            __pyx_t_6 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_6 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_6 >= __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 = 9932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_5 = (((*__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_2 = __pyx_t_5;
          __pyx_L10_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":9933
 *                 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":9935
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":9936
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_7 = __pyx_v_i;
            __pyx_t_3 = -1;
            if (__pyx_t_7 < 0) {
              __pyx_t_7 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_7 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_7 >= __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 = 9936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_2 = (((*__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_2) {

              /* "pandas/src/generated.pyx":9937
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L12;
            }
            __pyx_L12:;
          }
          __pyx_L9:;
          goto __pyx_L8;
        }

        /* "pandas/src/generated.pyx":9938
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":9939
 *                             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":9940
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_8 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_8 < 0) {
            __pyx_t_8 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_8 >= __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 = 9940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_2 = ((__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_2) {

            /* "pandas/src/generated.pyx":9941
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L13;
          }
          __pyx_L13:;
          goto __pyx_L8;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":9944
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L8:;
        goto __pyx_L7;
      }

      /* "pandas/src/generated.pyx":9945
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":9946
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":9947
 *             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":9949
 *                 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":9953
 *     # 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 = 9953; __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 = 9953; __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 = 9953; __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 = 9953; __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 = 9953; __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 = 9953; __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 = 9953; __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 = 9953; __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 = 9953; __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 = 9953; __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_3 = __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_3 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      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_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_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 = 9953; __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":9954
 * 
 *     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 = 9954; __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 = 9954; __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 = 9954; __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 = 9954; __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 = 9954; __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 = 9954; __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 = 9954; __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 = 9954; __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 = 9954; __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 = 9954; __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_3 = __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_3 < 0)) {
      PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
      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_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      }
    }
    __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 = 9954; __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":9955
 *     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 = 9955; __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 = 9955; __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 = 9955; __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 = 9955; __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 = 9955; __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 = 9955; __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 = 9955; __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 = 9955; __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 = 9955; __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 = 9955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_10);
  {
    __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_18, &__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_15, &__pyx_t_16, &__pyx_t_17);
      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_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_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 = 9955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_18 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "pandas/src/generated.pyx":9957
 *     result = np.empty(count, dtype=np.int64)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":9958
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":9959
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0:
 *         while i < nleft:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":9960
 *     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":9961
 *     count = 0
 *     if nleft > 0:
 *         while i < nleft:             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
    while (1) {
      __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
      if (!__pyx_t_2) break;

      /* "pandas/src/generated.pyx":9962
 *     if nleft > 0:
 *         while i < nleft:
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":9963
 *         while i < nleft:
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_2) break;

          /* "pandas/src/generated.pyx":9964
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_19 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_19 < 0) {
            __pyx_t_19 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_19 >= __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 = 9964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":9965
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     i += 1
 */
          __pyx_t_20 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_20 < 0) {
            __pyx_t_20 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
            if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_20 >= __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 = 9965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":9966
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     i += 1
 *                     count += 1
 */
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_3 = -1;
          if (__pyx_t_21 < 0) {
            __pyx_t_21 += __pyx_pybuffernd_left.diminfo[0].shape;
            if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_21 >= __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 = 9966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_22 = __pyx_v_count;
          __pyx_t_3 = -1;
          if (__pyx_t_22 < 0) {
            __pyx_t_22 += __pyx_pybuffernd_result.diminfo[0].shape;
            if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_22 >= __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 = 9966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides));

          /* "pandas/src/generated.pyx":9967
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     i += 1             # <<<<<<<<<<<<<<
 *                     count += 1
 *                 break
 */
          __pyx_v_i = (__pyx_v_i + 1);

          /* "pandas/src/generated.pyx":9968
 *                     result[count] = left[i]
 *                     i += 1
 *                     count += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_count = (__pyx_v_count + 1);
        }

        /* "pandas/src/generated.pyx":9969
 *                     i += 1
 *                     count += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L16_break;
      }

      /* "pandas/src/generated.pyx":9971
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_23 < 0) {
        __pyx_t_23 += __pyx_pybuffernd_left.diminfo[0].shape;
        if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_23 >= __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 = 9971; __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_23, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":9972
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_24 = __pyx_v_j;
      __pyx_t_3 = -1;
      if (__pyx_t_24 < 0) {
        __pyx_t_24 += __pyx_pybuffernd_right.diminfo[0].shape;
        if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_24 >= __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 = 9972; __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_24, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":9974
 *             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":9975
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_25 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_25 < 0) {
          __pyx_t_25 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_25 >= __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 = 9975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":9976
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_26 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_26 < 0) {
          __pyx_t_26 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_26 >= __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 = 9976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":9977
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_27 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_27 < 0) {
          __pyx_t_27 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_27 >= __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 = 9977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":9978
 *                 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":9979
 *                 result[count] = lval
 *                 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":9980
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_5) {
          } else {
            __pyx_t_2 = __pyx_t_5;
            goto __pyx_L23_bool_binop_done;
          }
          __pyx_t_28 = (__pyx_v_j + 1);
          __pyx_t_3 = -1;
          if (__pyx_t_28 < 0) {
            __pyx_t_28 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_28 >= __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 = 9980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
          __pyx_t_2 = __pyx_t_5;
          __pyx_L23_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":9981
 *                 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_L22;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":9983
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":9984
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_29 = __pyx_v_i;
            __pyx_t_3 = -1;
            if (__pyx_t_29 < 0) {
              __pyx_t_29 += __pyx_pybuffernd_left.diminfo[0].shape;
              if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_29 >= __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 = 9984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":9985
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L25;
            }
            __pyx_L25:;
          }
          __pyx_L22:;
          goto __pyx_L21;
        }

        /* "pandas/src/generated.pyx":9986
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":9987
 *                             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":9988
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_30 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_30 < 0) {
            __pyx_t_30 += __pyx_pybuffernd_right.diminfo[0].shape;
            if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_30 >= __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 = 9988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":9989
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L26;
          }
          __pyx_L26:;
          goto __pyx_L21;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":9992
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L16_break;
        }
        __pyx_L21:;
        goto __pyx_L20;
      }

      /* "pandas/src/generated.pyx":9993
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":9994
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 */
        __pyx_t_31 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_31 < 0) {
          __pyx_t_31 += __pyx_pybuffernd_lindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_31 >= __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 = 9994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":9995
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = left[i]
 *                 count += 1
 */
        __pyx_t_32 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_32 < 0) {
          __pyx_t_32 += __pyx_pybuffernd_rindexer.diminfo[0].shape;
          if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_32 >= __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 = 9995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":9996
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = left[i]             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_33 = __pyx_v_i;
        __pyx_t_3 = -1;
        if (__pyx_t_33 < 0) {
          __pyx_t_33 += __pyx_pybuffernd_left.diminfo[0].shape;
          if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_33 >= __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 = 9996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_34 = __pyx_v_count;
        __pyx_t_3 = -1;
        if (__pyx_t_34 < 0) {
          __pyx_t_34 += __pyx_pybuffernd_result.diminfo[0].shape;
          if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_34 >= __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 = 9996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_left.diminfo[0].strides));

        /* "pandas/src/generated.pyx":9997
 *                 rindexer[count] = -1
 *                 result[count] = left[i]
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":9998
 *                 result[count] = left[i]
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L20;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":10000
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L20:;
    }
    __pyx_L16_break:;
    goto __pyx_L14;
  }
  __pyx_L14:;

  /* "pandas/src/generated.pyx":10002
 *                 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 = 10002; __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":9903
 * 
 * 
 * def left_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.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":10007
 * @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_513outer_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_513outer_join_indexer_float64 = {"outer_join_indexer_float64", (PyCFunction)__pyx_pw_6pandas_5algos_513outer_join_indexer_float64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_513outer_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 = 10007; __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 = 10007; __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 = 10007; __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 = 10007; __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 = 10008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_512outer_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_512outer_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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  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 = 10007; __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 = 10007; __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":10015
 *         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 = 10015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":10016
 * 
 *     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 = 10016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":10018
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10019
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10020
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         count = nright
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10021
 *     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":10022
 *     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":10023
 *     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":10024
 *         count = nright
 *     elif nright == 0:
 *         count = nleft             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
    __pyx_v_count = __pyx_v_nleft;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":10026
 *         count = nleft
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 count += nright - j
 */
    while (1) {

      /* "pandas/src/generated.pyx":10027
 *     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":10028
 *         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":10029
 *             if i == nleft:
 *                 count += nright - j
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 count += nleft - i
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":10030
 *                 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":10031
 *                 break
 *             if j == nright:
 *                 count += nleft - i             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i));

        /* "pandas/src/generated.pyx":10032
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":10034
 *                 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":10035
 * 
 *             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":10036
 *             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":10037
 *             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":10038
 *             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":10039
 *                 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) {
          } else {
            __pyx_t_2 = __pyx_t_4;
            goto __pyx_L11_bool_binop_done;
          }
          __pyx_t_5 = (__pyx_v_j + 1);
          __pyx_t_4 = (((*__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_2 = __pyx_t_4;
          __pyx_L11_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10040
 *                 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":10042
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":10043
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_6 = __pyx_v_i;
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":10044
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L13;
            }
            __pyx_L13:;
          }
          __pyx_L10:;
          goto __pyx_L9;
        }

        /* "pandas/src/generated.pyx":10045
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":10046
 *                             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":10047
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_7 = __pyx_v_j;
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10048
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L14;
          }
          __pyx_L14:;
          goto __pyx_L9;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":10051
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L9:;
        goto __pyx_L8;
      }

      /* "pandas/src/generated.pyx":10052
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10053
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10054
 *             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":10056
 *                 i += 1
 *             else:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10057
 *             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":10059
 *                 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_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __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 = 10059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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 = 10059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10059; __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_10, __pyx_t_8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10059; __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_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 10059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":10060
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.float64)
 * 
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __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 = 10060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10060; __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 = 10060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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[2]; __pyx_lineno = 10060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
      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_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      }
    }
    __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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "pandas/src/generated.pyx":10061
 *     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_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_empty); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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[2]; __pyx_lineno = 10061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_9);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_18 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/generated.pyx":10065
 *     # do it again, but populate the indexers / result
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10066
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10067
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         for j in range(nright):
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10068
 *     j = 0
 *     count = 0
 *     if nleft == 0:             # <<<<<<<<<<<<<<
 *         for j in range(nright):
 *             lindexer[j] = -1
 */
  __pyx_t_2 = ((__pyx_v_nleft == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10069
 *     count = 0
 *     if nleft == 0:
 *         for j in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[j] = -1
 *             rindexer[j] = j
 */
    __pyx_t_19 = __pyx_v_nright;
    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":10070
 *     if nleft == 0:
 *         for j in range(nright):
 *             lindexer[j] = -1             # <<<<<<<<<<<<<<
 *             rindexer[j] = j
 *             result[j] = right[j]
 */
      __pyx_t_21 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":10071
 *         for j in range(nright):
 *             lindexer[j] = -1
 *             rindexer[j] = j             # <<<<<<<<<<<<<<
 *             result[j] = right[j]
 *     elif nright == 0:
 */
      __pyx_t_22 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":10072
 *             lindexer[j] = -1
 *             rindexer[j] = j
 *             result[j] = right[j]             # <<<<<<<<<<<<<<
 *     elif nright == 0:
 *         for i in range(nright):
 */
      __pyx_t_23 = __pyx_v_j;
      __pyx_t_24 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_right.diminfo[0].strides));
    }
    goto __pyx_L15;
  }

  /* "pandas/src/generated.pyx":10073
 *             rindexer[j] = j
 *             result[j] = right[j]
 *     elif nright == 0:             # <<<<<<<<<<<<<<
 *         for i in range(nright):
 *             lindexer[i] = i
 */
  __pyx_t_2 = ((__pyx_v_nright == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10074
 *             result[j] = right[j]
 *     elif nright == 0:
 *         for i in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[i] = i
 *             rindexer[i] = -1
 */
    __pyx_t_19 = __pyx_v_nright;
    for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
      __pyx_v_i = __pyx_t_20;

      /* "pandas/src/generated.pyx":10075
 *     elif nright == 0:
 *         for i in range(nright):
 *             lindexer[i] = i             # <<<<<<<<<<<<<<
 *             rindexer[i] = -1
 *             result[i] = left[i]
 */
      __pyx_t_25 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

      /* "pandas/src/generated.pyx":10076
 *         for i in range(nright):
 *             lindexer[i] = i
 *             rindexer[i] = -1             # <<<<<<<<<<<<<<
 *             result[i] = left[i]
 *     else:
 */
      __pyx_t_26 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":10077
 *             lindexer[i] = i
 *             rindexer[i] = -1
 *             result[i] = left[i]             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
      __pyx_t_27 = __pyx_v_i;
      __pyx_t_28 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_left.diminfo[0].strides));
    }
    goto __pyx_L15;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":10079
 *             result[i] = left[i]
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 while j < nright:
 */
    while (1) {

      /* "pandas/src/generated.pyx":10080
 *     else:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 while j < nright:
 *                     lindexer[count] = -1
 */
      __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10081
 *         while True:
 *             if i == nleft:
 *                 while j < nright:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 */
        while (1) {
          __pyx_t_2 = ((__pyx_v_j < __pyx_v_nright) != 0);
          if (!__pyx_t_2) break;

          /* "pandas/src/generated.pyx":10082
 *             if i == nleft:
 *                 while j < nright:
 *                     lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 */
          __pyx_t_19 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":10083
 *                 while j < nright:
 *                     lindexer[count] = -1
 *                     rindexer[count] = j             # <<<<<<<<<<<<<<
 *                     result[count] = right[j]
 *                     count += 1
 */
          __pyx_t_20 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

          /* "pandas/src/generated.pyx":10084
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 *                     result[count] = right[j]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     j += 1
 */
          __pyx_t_29 = __pyx_v_j;
          __pyx_t_30 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right.diminfo[0].strides));

          /* "pandas/src/generated.pyx":10085
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     j += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":10086
 *                     result[count] = right[j]
 *                     count += 1
 *                     j += 1             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "pandas/src/generated.pyx":10087
 *                     count += 1
 *                     j += 1
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10088
 *                     j += 1
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10089
 *                 break
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_2) break;

          /* "pandas/src/generated.pyx":10090
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_31 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":10091
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     count += 1
 */
          __pyx_t_32 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":10092
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     i += 1
 */
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_left.diminfo[0].strides));

          /* "pandas/src/generated.pyx":10093
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     i += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":10094
 *                     result[count] = left[i]
 *                     count += 1
 *                     i += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_i = (__pyx_v_i + 1);
        }

        /* "pandas/src/generated.pyx":10095
 *                     count += 1
 *                     i += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10097
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_35 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":10098
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_36 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":10100
 *             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":10101
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_37 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":10102
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_38 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":10103
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_39 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":10104
 *                 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":10105
 *                 result[count] = lval
 *                 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":10106
 *                 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) {
          } else {
            __pyx_t_2 = __pyx_t_4;
            goto __pyx_L31_bool_binop_done;
          }
          __pyx_t_40 = (__pyx_v_j + 1);
          __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
          __pyx_t_2 = __pyx_t_4;
          __pyx_L31_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10107
 *                 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_L30;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":10109
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":10110
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_41 = __pyx_v_i;
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":10111
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L33;
            }
            __pyx_L33:;
          }
          __pyx_L30:;
          goto __pyx_L29;
        }

        /* "pandas/src/generated.pyx":10112
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":10113
 *                             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":10114
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_42 = __pyx_v_j;
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10115
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L34;
          }
          __pyx_L34:;
          goto __pyx_L29;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":10118
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L21_break;
        }
        __pyx_L29:;
        goto __pyx_L28;
      }

      /* "pandas/src/generated.pyx":10119
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10120
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = lval
 */
        __pyx_t_43 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":10121
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_44 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":10122
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_45 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":10123
 *                 rindexer[count] = -1
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10124
 *                 result[count] = lval
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 lindexer[count] = -1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L28;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":10126
 *                 i += 1
 *             else:
 *                 lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_46 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":10127
 *             else:
 *                 lindexer[count] = -1
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_47 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":10128
 *                 lindexer[count] = -1
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 j += 1
 */
        __pyx_t_48 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval;

        /* "pandas/src/generated.pyx":10129
 *                 rindexer[count] = j
 *                 result[count] = rval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10130
 *                 result[count] = rval
 *                 count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L28:;
    }
    __pyx_L21_break:;
  }
  __pyx_L15:;

  /* "pandas/src/generated.pyx":10132
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":10007
 * @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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":10136
 * @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_515outer_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_515outer_join_indexer_float32 = {"outer_join_indexer_float32", (PyCFunction)__pyx_pw_6pandas_5algos_515outer_join_indexer_float32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_515outer_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 = 10136; __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 = 10136; __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 = 10136; __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 = 10136; __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 = 10137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_514outer_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_514outer_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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  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 = 10136; __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 = 10136; __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":10144
 *         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 = 10144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":10145
 * 
 *     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 = 10145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":10147
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10148
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10149
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         count = nright
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10150
 *     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":10151
 *     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":10152
 *     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":10153
 *         count = nright
 *     elif nright == 0:
 *         count = nleft             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
    __pyx_v_count = __pyx_v_nleft;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":10155
 *         count = nleft
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 count += nright - j
 */
    while (1) {

      /* "pandas/src/generated.pyx":10156
 *     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":10157
 *         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":10158
 *             if i == nleft:
 *                 count += nright - j
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 count += nleft - i
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":10159
 *                 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":10160
 *                 break
 *             if j == nright:
 *                 count += nleft - i             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i));

        /* "pandas/src/generated.pyx":10161
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":10163
 *                 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":10164
 * 
 *             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":10165
 *             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":10166
 *             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":10167
 *             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":10168
 *                 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) {
          } else {
            __pyx_t_2 = __pyx_t_4;
            goto __pyx_L11_bool_binop_done;
          }
          __pyx_t_5 = (__pyx_v_j + 1);
          __pyx_t_4 = (((*__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_2 = __pyx_t_4;
          __pyx_L11_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10169
 *                 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":10171
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":10172
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_6 = __pyx_v_i;
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":10173
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L13;
            }
            __pyx_L13:;
          }
          __pyx_L10:;
          goto __pyx_L9;
        }

        /* "pandas/src/generated.pyx":10174
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":10175
 *                             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":10176
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_7 = __pyx_v_j;
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10177
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L14;
          }
          __pyx_L14:;
          goto __pyx_L9;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":10180
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L9:;
        goto __pyx_L8;
      }

      /* "pandas/src/generated.pyx":10181
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10182
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10183
 *             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":10185
 *                 i += 1
 *             else:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10186
 *             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":10188
 *                 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_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __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 = 10188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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 = 10188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10188; __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_10, __pyx_t_8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10188; __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_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 10188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":10189
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.float32)
 * 
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __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 = 10189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10189; __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 = 10189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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[2]; __pyx_lineno = 10189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
      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_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      }
    }
    __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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "pandas/src/generated.pyx":10190
 *     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_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_empty); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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[2]; __pyx_lineno = 10190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_9);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_18 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/generated.pyx":10194
 *     # do it again, but populate the indexers / result
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10195
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10196
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         for j in range(nright):
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10197
 *     j = 0
 *     count = 0
 *     if nleft == 0:             # <<<<<<<<<<<<<<
 *         for j in range(nright):
 *             lindexer[j] = -1
 */
  __pyx_t_2 = ((__pyx_v_nleft == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10198
 *     count = 0
 *     if nleft == 0:
 *         for j in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[j] = -1
 *             rindexer[j] = j
 */
    __pyx_t_19 = __pyx_v_nright;
    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":10199
 *     if nleft == 0:
 *         for j in range(nright):
 *             lindexer[j] = -1             # <<<<<<<<<<<<<<
 *             rindexer[j] = j
 *             result[j] = right[j]
 */
      __pyx_t_21 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":10200
 *         for j in range(nright):
 *             lindexer[j] = -1
 *             rindexer[j] = j             # <<<<<<<<<<<<<<
 *             result[j] = right[j]
 *     elif nright == 0:
 */
      __pyx_t_22 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":10201
 *             lindexer[j] = -1
 *             rindexer[j] = j
 *             result[j] = right[j]             # <<<<<<<<<<<<<<
 *     elif nright == 0:
 *         for i in range(nright):
 */
      __pyx_t_23 = __pyx_v_j;
      __pyx_t_24 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_right.diminfo[0].strides));
    }
    goto __pyx_L15;
  }

  /* "pandas/src/generated.pyx":10202
 *             rindexer[j] = j
 *             result[j] = right[j]
 *     elif nright == 0:             # <<<<<<<<<<<<<<
 *         for i in range(nright):
 *             lindexer[i] = i
 */
  __pyx_t_2 = ((__pyx_v_nright == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10203
 *             result[j] = right[j]
 *     elif nright == 0:
 *         for i in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[i] = i
 *             rindexer[i] = -1
 */
    __pyx_t_19 = __pyx_v_nright;
    for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
      __pyx_v_i = __pyx_t_20;

      /* "pandas/src/generated.pyx":10204
 *     elif nright == 0:
 *         for i in range(nright):
 *             lindexer[i] = i             # <<<<<<<<<<<<<<
 *             rindexer[i] = -1
 *             result[i] = left[i]
 */
      __pyx_t_25 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

      /* "pandas/src/generated.pyx":10205
 *         for i in range(nright):
 *             lindexer[i] = i
 *             rindexer[i] = -1             # <<<<<<<<<<<<<<
 *             result[i] = left[i]
 *     else:
 */
      __pyx_t_26 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":10206
 *             lindexer[i] = i
 *             rindexer[i] = -1
 *             result[i] = left[i]             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
      __pyx_t_27 = __pyx_v_i;
      __pyx_t_28 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_left.diminfo[0].strides));
    }
    goto __pyx_L15;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":10208
 *             result[i] = left[i]
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 while j < nright:
 */
    while (1) {

      /* "pandas/src/generated.pyx":10209
 *     else:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 while j < nright:
 *                     lindexer[count] = -1
 */
      __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10210
 *         while True:
 *             if i == nleft:
 *                 while j < nright:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 */
        while (1) {
          __pyx_t_2 = ((__pyx_v_j < __pyx_v_nright) != 0);
          if (!__pyx_t_2) break;

          /* "pandas/src/generated.pyx":10211
 *             if i == nleft:
 *                 while j < nright:
 *                     lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 */
          __pyx_t_19 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":10212
 *                 while j < nright:
 *                     lindexer[count] = -1
 *                     rindexer[count] = j             # <<<<<<<<<<<<<<
 *                     result[count] = right[j]
 *                     count += 1
 */
          __pyx_t_20 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

          /* "pandas/src/generated.pyx":10213
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 *                     result[count] = right[j]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     j += 1
 */
          __pyx_t_29 = __pyx_v_j;
          __pyx_t_30 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right.diminfo[0].strides));

          /* "pandas/src/generated.pyx":10214
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     j += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":10215
 *                     result[count] = right[j]
 *                     count += 1
 *                     j += 1             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "pandas/src/generated.pyx":10216
 *                     count += 1
 *                     j += 1
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10217
 *                     j += 1
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10218
 *                 break
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_2) break;

          /* "pandas/src/generated.pyx":10219
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_31 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":10220
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     count += 1
 */
          __pyx_t_32 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":10221
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     i += 1
 */
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_left.diminfo[0].strides));

          /* "pandas/src/generated.pyx":10222
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     i += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":10223
 *                     result[count] = left[i]
 *                     count += 1
 *                     i += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_i = (__pyx_v_i + 1);
        }

        /* "pandas/src/generated.pyx":10224
 *                     count += 1
 *                     i += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10226
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_35 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":10227
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_36 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":10229
 *             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":10230
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_37 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":10231
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_38 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":10232
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_39 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":10233
 *                 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":10234
 *                 result[count] = lval
 *                 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":10235
 *                 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) {
          } else {
            __pyx_t_2 = __pyx_t_4;
            goto __pyx_L31_bool_binop_done;
          }
          __pyx_t_40 = (__pyx_v_j + 1);
          __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
          __pyx_t_2 = __pyx_t_4;
          __pyx_L31_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10236
 *                 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_L30;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":10238
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":10239
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_41 = __pyx_v_i;
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":10240
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L33;
            }
            __pyx_L33:;
          }
          __pyx_L30:;
          goto __pyx_L29;
        }

        /* "pandas/src/generated.pyx":10241
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":10242
 *                             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":10243
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_42 = __pyx_v_j;
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10244
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L34;
          }
          __pyx_L34:;
          goto __pyx_L29;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":10247
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L21_break;
        }
        __pyx_L29:;
        goto __pyx_L28;
      }

      /* "pandas/src/generated.pyx":10248
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10249
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = lval
 */
        __pyx_t_43 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":10250
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_44 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":10251
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_45 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":10252
 *                 rindexer[count] = -1
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10253
 *                 result[count] = lval
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 lindexer[count] = -1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L28;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":10255
 *                 i += 1
 *             else:
 *                 lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_46 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":10256
 *             else:
 *                 lindexer[count] = -1
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_47 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":10257
 *                 lindexer[count] = -1
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 j += 1
 */
        __pyx_t_48 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval;

        /* "pandas/src/generated.pyx":10258
 *                 rindexer[count] = j
 *                 result[count] = rval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10259
 *                 result[count] = rval
 *                 count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L28:;
    }
    __pyx_L21_break:;
  }
  __pyx_L15:;

  /* "pandas/src/generated.pyx":10261
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":10136
 * @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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":10265
 * @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_517outer_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_517outer_join_indexer_object = {"outer_join_indexer_object", (PyCFunction)__pyx_pw_6pandas_5algos_517outer_join_indexer_object, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_517outer_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 = 10265; __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 = 10265; __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 = 10265; __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 = 10265; __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 = 10266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_516outer_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_516outer_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;
  int __pyx_t_5;
  Py_ssize_t __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;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  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;
  PyObject **__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_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 = 10265; __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 = 10265; __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":10273
 *         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 = 10273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":10274
 * 
 *     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 = 10274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":10276
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10277
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10278
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         count = nright
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10279
 *     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":10280
 *     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":10281
 *     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":10282
 *         count = nright
 *     elif nright == 0:
 *         count = nleft             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
    __pyx_v_count = __pyx_v_nleft;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":10284
 *         count = nleft
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 count += nright - j
 */
    while (1) {

      /* "pandas/src/generated.pyx":10285
 *     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":10286
 *         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":10287
 *             if i == nleft:
 *                 count += nright - j
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 count += nleft - i
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":10288
 *                 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":10289
 *                 break
 *             if j == nright:
 *                 count += nleft - i             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i));

        /* "pandas/src/generated.pyx":10290
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":10292
 *                 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":10293
 * 
 *             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":10294
 *             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 = 10294; __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 = 10294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10295
 *             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":10296
 *             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":10297
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_5) {
          } else {
            __pyx_t_2 = __pyx_t_5;
            goto __pyx_L11_bool_binop_done;
          }
          __pyx_t_6 = (__pyx_v_j + 1);
          __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 = 10297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_2 = __pyx_t_5;
          __pyx_L11_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10298
 *                 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":10300
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":10301
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_8 = __pyx_v_i;
            __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_8, __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 = 10301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":10302
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L13;
            }
            __pyx_L13:;
          }
          __pyx_L10:;
          goto __pyx_L9;
        }

        /* "pandas/src/generated.pyx":10303
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":10304
 *                             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":10305
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_9 = __pyx_v_j;
          __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_9, __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 = 10305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10306
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L14;
          }
          __pyx_L14:;
          goto __pyx_L9;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":10309
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L9:;
        goto __pyx_L8;
      }

      /* "pandas/src/generated.pyx":10310
 *                     # 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 = 10310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10311
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10312
 *             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":10314
 *                 i += 1
 *             else:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10315
 *             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":10317
 *                 j += 1
 * 
 *     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 = 10317; __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 = 10317; __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 = 10317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10317; __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);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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 = 10317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":10318
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=object)
 * 
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __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 = 10318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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[2]; __pyx_lineno = 10318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
      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_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      }
    }
    __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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "pandas/src/generated.pyx":10319
 *     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_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_empty); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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[2]; __pyx_lineno = 10319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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 = 10319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_18 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "pandas/src/generated.pyx":10323
 *     # do it again, but populate the indexers / result
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10324
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10325
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         for j in range(nright):
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10326
 *     j = 0
 *     count = 0
 *     if nleft == 0:             # <<<<<<<<<<<<<<
 *         for j in range(nright):
 *             lindexer[j] = -1
 */
  __pyx_t_2 = ((__pyx_v_nleft == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10327
 *     count = 0
 *     if nleft == 0:
 *         for j in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[j] = -1
 *             rindexer[j] = j
 */
    __pyx_t_19 = __pyx_v_nright;
    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":10328
 *     if nleft == 0:
 *         for j in range(nright):
 *             lindexer[j] = -1             # <<<<<<<<<<<<<<
 *             rindexer[j] = j
 *             result[j] = right[j]
 */
      __pyx_t_21 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":10329
 *         for j in range(nright):
 *             lindexer[j] = -1
 *             rindexer[j] = j             # <<<<<<<<<<<<<<
 *             result[j] = right[j]
 *     elif nright == 0:
 */
      __pyx_t_22 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":10330
 *             lindexer[j] = -1
 *             rindexer[j] = j
 *             result[j] = right[j]             # <<<<<<<<<<<<<<
 *     elif nright == 0:
 *         for i in range(nright):
 */
      __pyx_t_23 = __pyx_v_j;
      __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_right.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_7);
      __pyx_t_24 = __pyx_v_j;
      __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_t_7); __Pyx_DECREF(*__pyx_t_25);
      *__pyx_t_25 = __pyx_t_7;
      __Pyx_GIVEREF(*__pyx_t_25);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    goto __pyx_L15;
  }

  /* "pandas/src/generated.pyx":10331
 *             rindexer[j] = j
 *             result[j] = right[j]
 *     elif nright == 0:             # <<<<<<<<<<<<<<
 *         for i in range(nright):
 *             lindexer[i] = i
 */
  __pyx_t_2 = ((__pyx_v_nright == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10332
 *             result[j] = right[j]
 *     elif nright == 0:
 *         for i in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[i] = i
 *             rindexer[i] = -1
 */
    __pyx_t_19 = __pyx_v_nright;
    for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
      __pyx_v_i = __pyx_t_20;

      /* "pandas/src/generated.pyx":10333
 *     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":10334
 *         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":10335
 *             lindexer[i] = i
 *             rindexer[i] = -1
 *             result[i] = left[i]             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
      __pyx_t_28 = __pyx_v_i;
      __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_7);
      __pyx_t_29 = __pyx_v_i;
      __pyx_t_25 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_result.diminfo[0].strides);
      __Pyx_GOTREF(*__pyx_t_25);
      __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(*__pyx_t_25);
      *__pyx_t_25 = __pyx_t_7;
      __Pyx_GIVEREF(*__pyx_t_25);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    goto __pyx_L15;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":10337
 *             result[i] = left[i]
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 while j < nright:
 */
    while (1) {

      /* "pandas/src/generated.pyx":10338
 *     else:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 while j < nright:
 *                     lindexer[count] = -1
 */
      __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10339
 *         while True:
 *             if i == nleft:
 *                 while j < nright:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 */
        while (1) {
          __pyx_t_2 = ((__pyx_v_j < __pyx_v_nright) != 0);
          if (!__pyx_t_2) break;

          /* "pandas/src/generated.pyx":10340
 *             if i == nleft:
 *                 while j < nright:
 *                     lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 */
          __pyx_t_19 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":10341
 *                 while j < nright:
 *                     lindexer[count] = -1
 *                     rindexer[count] = j             # <<<<<<<<<<<<<<
 *                     result[count] = right[j]
 *                     count += 1
 */
          __pyx_t_20 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

          /* "pandas/src/generated.pyx":10342
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 *                     result[count] = right[j]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     j += 1
 */
          __pyx_t_30 = __pyx_v_j;
          __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_31 = __pyx_v_count;
          __pyx_t_25 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides);
          __Pyx_GOTREF(*__pyx_t_25);
          __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(*__pyx_t_25);
          *__pyx_t_25 = __pyx_t_7;
          __Pyx_GIVEREF(*__pyx_t_25);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "pandas/src/generated.pyx":10343
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     j += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":10344
 *                     result[count] = right[j]
 *                     count += 1
 *                     j += 1             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "pandas/src/generated.pyx":10345
 *                     count += 1
 *                     j += 1
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10346
 *                     j += 1
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10347
 *                 break
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_2) break;

          /* "pandas/src/generated.pyx":10348
 *             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":10349
 *                 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":10350
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     i += 1
 */
          __pyx_t_34 = __pyx_v_i;
          __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_7);
          __pyx_t_35 = __pyx_v_count;
          __pyx_t_25 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides);
          __Pyx_GOTREF(*__pyx_t_25);
          __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(*__pyx_t_25);
          *__pyx_t_25 = __pyx_t_7;
          __Pyx_GIVEREF(*__pyx_t_25);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "pandas/src/generated.pyx":10351
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     i += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":10352
 *                     result[count] = left[i]
 *                     count += 1
 *                     i += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_i = (__pyx_v_i + 1);
        }

        /* "pandas/src/generated.pyx":10353
 *                     count += 1
 *                     i += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10355
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_36 = __pyx_v_i;
      __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_36, __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":10356
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_37 = __pyx_v_j;
      __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_37, __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":10358
 *             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 = 10358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10359
 * 
 *             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":10360
 *             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":10361
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_40 = __pyx_v_count;
        __pyx_t_25 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_result.diminfo[0].strides);
        __Pyx_GOTREF(*__pyx_t_25);
        __Pyx_INCREF(__pyx_v_lval); __Pyx_DECREF(*__pyx_t_25);
        *__pyx_t_25 = __pyx_v_lval;
        __Pyx_GIVEREF(*__pyx_t_25);

        /* "pandas/src/generated.pyx":10362
 *                 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":10363
 *                 result[count] = lval
 *                 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":10364
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_5) {
          } else {
            __pyx_t_2 = __pyx_t_5;
            goto __pyx_L31_bool_binop_done;
          }
          __pyx_t_41 = (__pyx_v_j + 1);
          __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_right.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_7);
          __pyx_t_11 = PyObject_RichCompare(__pyx_t_7, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_2 = __pyx_t_5;
          __pyx_L31_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10365
 *                 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_L30;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":10367
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":10368
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_42 = __pyx_v_i;
            __pyx_t_11 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_left.diminfo[0].strides);
            __Pyx_INCREF((PyObject*)__pyx_t_11);
            __pyx_t_7 = PyObject_RichCompare(__pyx_t_11, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":10369
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L33;
            }
            __pyx_L33:;
          }
          __pyx_L30:;
          goto __pyx_L29;
        }

        /* "pandas/src/generated.pyx":10370
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":10371
 *                             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":10372
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_43 = __pyx_v_j;
          __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_right.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_7);
          __pyx_t_11 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10373
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L34;
          }
          __pyx_L34:;
          goto __pyx_L29;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":10376
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L21_break;
        }
        __pyx_L29:;
        goto __pyx_L28;
      }

      /* "pandas/src/generated.pyx":10377
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_11 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10378
 *                     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":10379
 *             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":10380
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_46 = __pyx_v_count;
        __pyx_t_25 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides);
        __Pyx_GOTREF(*__pyx_t_25);
        __Pyx_INCREF(__pyx_v_lval); __Pyx_DECREF(*__pyx_t_25);
        *__pyx_t_25 = __pyx_v_lval;
        __Pyx_GIVEREF(*__pyx_t_25);

        /* "pandas/src/generated.pyx":10381
 *                 rindexer[count] = -1
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10382
 *                 result[count] = lval
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 lindexer[count] = -1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L28;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":10384
 *                 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":10385
 *             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":10386
 *                 lindexer[count] = -1
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 j += 1
 */
        __pyx_t_49 = __pyx_v_count;
        __pyx_t_25 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_49, __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":10387
 *                 rindexer[count] = j
 *                 result[count] = rval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10388
 *                 result[count] = rval
 *                 count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L28:;
    }
    __pyx_L21_break:;
  }
  __pyx_L15:;

  /* "pandas/src/generated.pyx":10390
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10390; __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":10265
 * @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_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":10394
 * @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_519outer_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_519outer_join_indexer_int32 = {"outer_join_indexer_int32", (PyCFunction)__pyx_pw_6pandas_5algos_519outer_join_indexer_int32, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_519outer_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 = 10394; __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 = 10394; __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 = 10394; __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 = 10394; __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 = 10395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_518outer_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_518outer_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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  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 = 10394; __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 = 10394; __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":10402
 *         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 = 10402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":10403
 * 
 *     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 = 10403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":10405
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10406
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10407
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         count = nright
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10408
 *     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":10409
 *     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":10410
 *     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":10411
 *         count = nright
 *     elif nright == 0:
 *         count = nleft             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
    __pyx_v_count = __pyx_v_nleft;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":10413
 *         count = nleft
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 count += nright - j
 */
    while (1) {

      /* "pandas/src/generated.pyx":10414
 *     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":10415
 *         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":10416
 *             if i == nleft:
 *                 count += nright - j
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 count += nleft - i
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":10417
 *                 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":10418
 *                 break
 *             if j == nright:
 *                 count += nleft - i             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i));

        /* "pandas/src/generated.pyx":10419
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":10421
 *                 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":10422
 * 
 *             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":10423
 *             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":10424
 *             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":10425
 *             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":10426
 *                 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) {
          } else {
            __pyx_t_2 = __pyx_t_4;
            goto __pyx_L11_bool_binop_done;
          }
          __pyx_t_5 = (__pyx_v_j + 1);
          __pyx_t_4 = (((*__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_2 = __pyx_t_4;
          __pyx_L11_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10427
 *                 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":10429
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":10430
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_6 = __pyx_v_i;
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":10431
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L13;
            }
            __pyx_L13:;
          }
          __pyx_L10:;
          goto __pyx_L9;
        }

        /* "pandas/src/generated.pyx":10432
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":10433
 *                             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":10434
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_7 = __pyx_v_j;
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10435
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L14;
          }
          __pyx_L14:;
          goto __pyx_L9;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":10438
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L9:;
        goto __pyx_L8;
      }

      /* "pandas/src/generated.pyx":10439
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10440
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10441
 *             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":10443
 *                 i += 1
 *             else:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10444
 *             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":10446
 *                 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_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __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 = 10446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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 = 10446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10446; __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_10, __pyx_t_8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10446; __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_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 10446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":10447
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.int32)
 * 
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __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 = 10447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10447; __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 = 10447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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[2]; __pyx_lineno = 10447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
      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_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      }
    }
    __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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "pandas/src/generated.pyx":10448
 *     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_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_empty); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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[2]; __pyx_lineno = 10448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int32); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_9);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_18 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/generated.pyx":10452
 *     # do it again, but populate the indexers / result
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10453
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10454
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         for j in range(nright):
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10455
 *     j = 0
 *     count = 0
 *     if nleft == 0:             # <<<<<<<<<<<<<<
 *         for j in range(nright):
 *             lindexer[j] = -1
 */
  __pyx_t_2 = ((__pyx_v_nleft == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10456
 *     count = 0
 *     if nleft == 0:
 *         for j in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[j] = -1
 *             rindexer[j] = j
 */
    __pyx_t_19 = __pyx_v_nright;
    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":10457
 *     if nleft == 0:
 *         for j in range(nright):
 *             lindexer[j] = -1             # <<<<<<<<<<<<<<
 *             rindexer[j] = j
 *             result[j] = right[j]
 */
      __pyx_t_21 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":10458
 *         for j in range(nright):
 *             lindexer[j] = -1
 *             rindexer[j] = j             # <<<<<<<<<<<<<<
 *             result[j] = right[j]
 *     elif nright == 0:
 */
      __pyx_t_22 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":10459
 *             lindexer[j] = -1
 *             rindexer[j] = j
 *             result[j] = right[j]             # <<<<<<<<<<<<<<
 *     elif nright == 0:
 *         for i in range(nright):
 */
      __pyx_t_23 = __pyx_v_j;
      __pyx_t_24 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_right.diminfo[0].strides));
    }
    goto __pyx_L15;
  }

  /* "pandas/src/generated.pyx":10460
 *             rindexer[j] = j
 *             result[j] = right[j]
 *     elif nright == 0:             # <<<<<<<<<<<<<<
 *         for i in range(nright):
 *             lindexer[i] = i
 */
  __pyx_t_2 = ((__pyx_v_nright == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10461
 *             result[j] = right[j]
 *     elif nright == 0:
 *         for i in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[i] = i
 *             rindexer[i] = -1
 */
    __pyx_t_19 = __pyx_v_nright;
    for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
      __pyx_v_i = __pyx_t_20;

      /* "pandas/src/generated.pyx":10462
 *     elif nright == 0:
 *         for i in range(nright):
 *             lindexer[i] = i             # <<<<<<<<<<<<<<
 *             rindexer[i] = -1
 *             result[i] = left[i]
 */
      __pyx_t_25 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

      /* "pandas/src/generated.pyx":10463
 *         for i in range(nright):
 *             lindexer[i] = i
 *             rindexer[i] = -1             # <<<<<<<<<<<<<<
 *             result[i] = left[i]
 *     else:
 */
      __pyx_t_26 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":10464
 *             lindexer[i] = i
 *             rindexer[i] = -1
 *             result[i] = left[i]             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
      __pyx_t_27 = __pyx_v_i;
      __pyx_t_28 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_left.diminfo[0].strides));
    }
    goto __pyx_L15;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":10466
 *             result[i] = left[i]
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 while j < nright:
 */
    while (1) {

      /* "pandas/src/generated.pyx":10467
 *     else:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 while j < nright:
 *                     lindexer[count] = -1
 */
      __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10468
 *         while True:
 *             if i == nleft:
 *                 while j < nright:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 */
        while (1) {
          __pyx_t_2 = ((__pyx_v_j < __pyx_v_nright) != 0);
          if (!__pyx_t_2) break;

          /* "pandas/src/generated.pyx":10469
 *             if i == nleft:
 *                 while j < nright:
 *                     lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 */
          __pyx_t_19 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":10470
 *                 while j < nright:
 *                     lindexer[count] = -1
 *                     rindexer[count] = j             # <<<<<<<<<<<<<<
 *                     result[count] = right[j]
 *                     count += 1
 */
          __pyx_t_20 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

          /* "pandas/src/generated.pyx":10471
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 *                     result[count] = right[j]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     j += 1
 */
          __pyx_t_29 = __pyx_v_j;
          __pyx_t_30 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right.diminfo[0].strides));

          /* "pandas/src/generated.pyx":10472
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     j += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":10473
 *                     result[count] = right[j]
 *                     count += 1
 *                     j += 1             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "pandas/src/generated.pyx":10474
 *                     count += 1
 *                     j += 1
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10475
 *                     j += 1
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10476
 *                 break
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_2) break;

          /* "pandas/src/generated.pyx":10477
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_31 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":10478
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     count += 1
 */
          __pyx_t_32 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":10479
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     i += 1
 */
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_left.diminfo[0].strides));

          /* "pandas/src/generated.pyx":10480
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     i += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":10481
 *                     result[count] = left[i]
 *                     count += 1
 *                     i += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_i = (__pyx_v_i + 1);
        }

        /* "pandas/src/generated.pyx":10482
 *                     count += 1
 *                     i += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10484
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_35 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":10485
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_36 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":10487
 *             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":10488
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_37 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":10489
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_38 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":10490
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_39 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":10491
 *                 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":10492
 *                 result[count] = lval
 *                 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":10493
 *                 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) {
          } else {
            __pyx_t_2 = __pyx_t_4;
            goto __pyx_L31_bool_binop_done;
          }
          __pyx_t_40 = (__pyx_v_j + 1);
          __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
          __pyx_t_2 = __pyx_t_4;
          __pyx_L31_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10494
 *                 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_L30;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":10496
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":10497
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_41 = __pyx_v_i;
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":10498
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L33;
            }
            __pyx_L33:;
          }
          __pyx_L30:;
          goto __pyx_L29;
        }

        /* "pandas/src/generated.pyx":10499
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":10500
 *                             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":10501
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_42 = __pyx_v_j;
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10502
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L34;
          }
          __pyx_L34:;
          goto __pyx_L29;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":10505
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L21_break;
        }
        __pyx_L29:;
        goto __pyx_L28;
      }

      /* "pandas/src/generated.pyx":10506
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10507
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = lval
 */
        __pyx_t_43 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":10508
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_44 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":10509
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_45 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":10510
 *                 rindexer[count] = -1
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10511
 *                 result[count] = lval
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 lindexer[count] = -1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L28;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":10513
 *                 i += 1
 *             else:
 *                 lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_46 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":10514
 *             else:
 *                 lindexer[count] = -1
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_47 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":10515
 *                 lindexer[count] = -1
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 j += 1
 */
        __pyx_t_48 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval;

        /* "pandas/src/generated.pyx":10516
 *                 rindexer[count] = j
 *                 result[count] = rval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10517
 *                 result[count] = rval
 *                 count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L28:;
    }
    __pyx_L21_break:;
  }
  __pyx_L15:;

  /* "pandas/src/generated.pyx":10519
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":10394
 * @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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":10523
 * @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_521outer_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_5algos_521outer_join_indexer_int64 = {"outer_join_indexer_int64", (PyCFunction)__pyx_pw_6pandas_5algos_521outer_join_indexer_int64, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_5algos_521outer_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 = 10523; __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 = 10523; __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 = 10523; __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 = 10523; __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 = 10524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_520outer_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_520outer_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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  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 = 10523; __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 = 10523; __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":10531
 *         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 = 10531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":10532
 * 
 *     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 = 10532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":10534
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10535
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10536
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         count = nright
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10537
 *     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":10538
 *     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":10539
 *     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":10540
 *         count = nright
 *     elif nright == 0:
 *         count = nleft             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
    __pyx_v_count = __pyx_v_nleft;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":10542
 *         count = nleft
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 count += nright - j
 */
    while (1) {

      /* "pandas/src/generated.pyx":10543
 *     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":10544
 *         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":10545
 *             if i == nleft:
 *                 count += nright - j
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 count += nleft - i
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":10546
 *                 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":10547
 *                 break
 *             if j == nright:
 *                 count += nleft - i             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i));

        /* "pandas/src/generated.pyx":10548
 *             if j == nright:
 *                 count += nleft - i
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L5_break;
      }

      /* "pandas/src/generated.pyx":10550
 *                 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":10551
 * 
 *             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":10552
 *             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":10553
 *             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":10554
 *             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":10555
 *                 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) {
          } else {
            __pyx_t_2 = __pyx_t_4;
            goto __pyx_L11_bool_binop_done;
          }
          __pyx_t_5 = (__pyx_v_j + 1);
          __pyx_t_4 = (((*__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_2 = __pyx_t_4;
          __pyx_L11_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10556
 *                 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":10558
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":10559
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_6 = __pyx_v_i;
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":10560
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L13;
            }
            __pyx_L13:;
          }
          __pyx_L10:;
          goto __pyx_L9;
        }

        /* "pandas/src/generated.pyx":10561
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":10562
 *                             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":10563
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_7 = __pyx_v_j;
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10564
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L14;
          }
          __pyx_L14:;
          goto __pyx_L9;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":10567
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 count += 1
 */
          goto __pyx_L5_break;
        }
        __pyx_L9:;
        goto __pyx_L8;
      }

      /* "pandas/src/generated.pyx":10568
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10569
 *                     break
 *             elif lval < rval:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10570
 *             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":10572
 *                 i += 1
 *             else:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10573
 *             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":10575
 *                 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_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __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 = 10575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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 = 10575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10575; __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_10, __pyx_t_8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10575; __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_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 10575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":10576
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.int64)
 * 
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __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 = 10576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10576; __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 = 10576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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[2]; __pyx_lineno = 10576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
      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_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      }
    }
    __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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "pandas/src/generated.pyx":10577
 *     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_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_empty); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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[2]; __pyx_lineno = 10577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_9);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_18 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/generated.pyx":10581
 *     # do it again, but populate the indexers / result
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10582
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft == 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10583
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft == 0:
 *         for j in range(nright):
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10584
 *     j = 0
 *     count = 0
 *     if nleft == 0:             # <<<<<<<<<<<<<<
 *         for j in range(nright):
 *             lindexer[j] = -1
 */
  __pyx_t_2 = ((__pyx_v_nleft == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10585
 *     count = 0
 *     if nleft == 0:
 *         for j in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[j] = -1
 *             rindexer[j] = j
 */
    __pyx_t_19 = __pyx_v_nright;
    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":10586
 *     if nleft == 0:
 *         for j in range(nright):
 *             lindexer[j] = -1             # <<<<<<<<<<<<<<
 *             rindexer[j] = j
 *             result[j] = right[j]
 */
      __pyx_t_21 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":10587
 *         for j in range(nright):
 *             lindexer[j] = -1
 *             rindexer[j] = j             # <<<<<<<<<<<<<<
 *             result[j] = right[j]
 *     elif nright == 0:
 */
      __pyx_t_22 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

      /* "pandas/src/generated.pyx":10588
 *             lindexer[j] = -1
 *             rindexer[j] = j
 *             result[j] = right[j]             # <<<<<<<<<<<<<<
 *     elif nright == 0:
 *         for i in range(nright):
 */
      __pyx_t_23 = __pyx_v_j;
      __pyx_t_24 = __pyx_v_j;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_right.diminfo[0].strides));
    }
    goto __pyx_L15;
  }

  /* "pandas/src/generated.pyx":10589
 *             rindexer[j] = j
 *             result[j] = right[j]
 *     elif nright == 0:             # <<<<<<<<<<<<<<
 *         for i in range(nright):
 *             lindexer[i] = i
 */
  __pyx_t_2 = ((__pyx_v_nright == 0) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10590
 *             result[j] = right[j]
 *     elif nright == 0:
 *         for i in range(nright):             # <<<<<<<<<<<<<<
 *             lindexer[i] = i
 *             rindexer[i] = -1
 */
    __pyx_t_19 = __pyx_v_nright;
    for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
      __pyx_v_i = __pyx_t_20;

      /* "pandas/src/generated.pyx":10591
 *     elif nright == 0:
 *         for i in range(nright):
 *             lindexer[i] = i             # <<<<<<<<<<<<<<
 *             rindexer[i] = -1
 *             result[i] = left[i]
 */
      __pyx_t_25 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

      /* "pandas/src/generated.pyx":10592
 *         for i in range(nright):
 *             lindexer[i] = i
 *             rindexer[i] = -1             # <<<<<<<<<<<<<<
 *             result[i] = left[i]
 *     else:
 */
      __pyx_t_26 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

      /* "pandas/src/generated.pyx":10593
 *             lindexer[i] = i
 *             rindexer[i] = -1
 *             result[i] = left[i]             # <<<<<<<<<<<<<<
 *     else:
 *         while True:
 */
      __pyx_t_27 = __pyx_v_i;
      __pyx_t_28 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_left.diminfo[0].strides));
    }
    goto __pyx_L15;
  }
  /*else*/ {

    /* "pandas/src/generated.pyx":10595
 *             result[i] = left[i]
 *     else:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 while j < nright:
 */
    while (1) {

      /* "pandas/src/generated.pyx":10596
 *     else:
 *         while True:
 *             if i == nleft:             # <<<<<<<<<<<<<<
 *                 while j < nright:
 *                     lindexer[count] = -1
 */
      __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10597
 *         while True:
 *             if i == nleft:
 *                 while j < nright:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 */
        while (1) {
          __pyx_t_2 = ((__pyx_v_j < __pyx_v_nright) != 0);
          if (!__pyx_t_2) break;

          /* "pandas/src/generated.pyx":10598
 *             if i == nleft:
 *                 while j < nright:
 *                     lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 */
          __pyx_t_19 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":10599
 *                 while j < nright:
 *                     lindexer[count] = -1
 *                     rindexer[count] = j             # <<<<<<<<<<<<<<
 *                     result[count] = right[j]
 *                     count += 1
 */
          __pyx_t_20 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

          /* "pandas/src/generated.pyx":10600
 *                     lindexer[count] = -1
 *                     rindexer[count] = j
 *                     result[count] = right[j]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     j += 1
 */
          __pyx_t_29 = __pyx_v_j;
          __pyx_t_30 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right.diminfo[0].strides));

          /* "pandas/src/generated.pyx":10601
 *                     rindexer[count] = j
 *                     result[count] = right[j]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     j += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":10602
 *                     result[count] = right[j]
 *                     count += 1
 *                     j += 1             # <<<<<<<<<<<<<<
 *                 break
 *             if j == nright:
 */
          __pyx_v_j = (__pyx_v_j + 1);
        }

        /* "pandas/src/generated.pyx":10603
 *                     count += 1
 *                     j += 1
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 while i < nleft:
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10604
 *                     j += 1
 *                 break
 *             if j == nright:             # <<<<<<<<<<<<<<
 *                 while i < nleft:
 *                     lindexer[count] = i
 */
      __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10605
 *                 break
 *             if j == nright:
 *                 while i < nleft:             # <<<<<<<<<<<<<<
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 */
        while (1) {
          __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0);
          if (!__pyx_t_2) break;

          /* "pandas/src/generated.pyx":10606
 *             if j == nright:
 *                 while i < nleft:
 *                     lindexer[count] = i             # <<<<<<<<<<<<<<
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 */
          __pyx_t_31 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

          /* "pandas/src/generated.pyx":10607
 *                 while i < nleft:
 *                     lindexer[count] = i
 *                     rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                     result[count] = left[i]
 *                     count += 1
 */
          __pyx_t_32 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

          /* "pandas/src/generated.pyx":10608
 *                     lindexer[count] = i
 *                     rindexer[count] = -1
 *                     result[count] = left[i]             # <<<<<<<<<<<<<<
 *                     count += 1
 *                     i += 1
 */
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_count;
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_left.diminfo[0].strides));

          /* "pandas/src/generated.pyx":10609
 *                     rindexer[count] = -1
 *                     result[count] = left[i]
 *                     count += 1             # <<<<<<<<<<<<<<
 *                     i += 1
 *                 break
 */
          __pyx_v_count = (__pyx_v_count + 1);

          /* "pandas/src/generated.pyx":10610
 *                     result[count] = left[i]
 *                     count += 1
 *                     i += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
          __pyx_v_i = (__pyx_v_i + 1);
        }

        /* "pandas/src/generated.pyx":10611
 *                     count += 1
 *                     i += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10613
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 * 
 */
      __pyx_t_35 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":10614
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 * 
 *             if lval == rval:
 */
      __pyx_t_36 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":10616
 *             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":10617
 * 
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = lval
 */
        __pyx_t_37 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":10618
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_38 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":10619
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_39 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":10620
 *                 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":10621
 *                 result[count] = lval
 *                 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":10622
 *                 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) {
          } else {
            __pyx_t_2 = __pyx_t_4;
            goto __pyx_L31_bool_binop_done;
          }
          __pyx_t_40 = (__pyx_v_j + 1);
          __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
          __pyx_t_2 = __pyx_t_4;
          __pyx_L31_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10623
 *                 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_L30;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":10625
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":10626
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_41 = __pyx_v_i;
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":10627
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L33;
            }
            __pyx_L33:;
          }
          __pyx_L30:;
          goto __pyx_L29;
        }

        /* "pandas/src/generated.pyx":10628
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":10629
 *                             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":10630
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_42 = __pyx_v_j;
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10631
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L34;
          }
          __pyx_L34:;
          goto __pyx_L29;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":10634
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 lindexer[count] = i
 */
          goto __pyx_L21_break;
        }
        __pyx_L29:;
        goto __pyx_L28;
      }

      /* "pandas/src/generated.pyx":10635
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10636
 *                     break
 *             elif lval < rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = -1
 *                 result[count] = lval
 */
        __pyx_t_43 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":10637
 *             elif lval < rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 result[count] = lval
 *                 count += 1
 */
        __pyx_t_44 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":10638
 *                 lindexer[count] = i
 *                 rindexer[count] = -1
 *                 result[count] = lval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 i += 1
 */
        __pyx_t_45 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval;

        /* "pandas/src/generated.pyx":10639
 *                 rindexer[count] = -1
 *                 result[count] = lval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10640
 *                 result[count] = lval
 *                 count += 1
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 lindexer[count] = -1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L28;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":10642
 *                 i += 1
 *             else:
 *                 lindexer[count] = -1             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_46 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1;

        /* "pandas/src/generated.pyx":10643
 *             else:
 *                 lindexer[count] = -1
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_47 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":10644
 *                 lindexer[count] = -1
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 j += 1
 */
        __pyx_t_48 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval;

        /* "pandas/src/generated.pyx":10645
 *                 rindexer[count] = j
 *                 result[count] = rval
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        __pyx_v_count = (__pyx_v_count + 1);

        /* "pandas/src/generated.pyx":10646
 *                 result[count] = rval
 *                 count += 1
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L28:;
    }
    __pyx_L21_break:;
  }
  __pyx_L15:;

  /* "pandas/src/generated.pyx":10648
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":10523
 * @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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":10653
 * @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_523inner_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_522inner_join_indexer_float64[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_523inner_join_indexer_float64 = {"inner_join_indexer_float64", (PyCFunction)__pyx_pw_6pandas_5algos_523inner_join_indexer_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_522inner_join_indexer_float64};
static PyObject *__pyx_pw_6pandas_5algos_523inner_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 = 10653; __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 = 10653; __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 = 10653; __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 = 10653; __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 = 10654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_522inner_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_522inner_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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  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;
  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 = 10653; __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 = 10653; __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":10664
 *         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 = 10664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":10665
 * 
 *     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 = 10665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":10667
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10668
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10669
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10670
 *     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) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_nright > 0) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10671
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":10672
 *     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":10673
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L7_break;
      }

      /* "pandas/src/generated.pyx":10674
 *             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":10675
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L7_break;
      }

      /* "pandas/src/generated.pyx":10677
 *                 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":10678
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 count += 1
 */
      __pyx_t_4 = __pyx_v_j;
      __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":10679
 *             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":10680
 *             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":10681
 *             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":10682
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_3) {
          } else {
            __pyx_t_2 = __pyx_t_3;
            goto __pyx_L13_bool_binop_done;
          }
          __pyx_t_5 = (__pyx_v_j + 1);
          __pyx_t_3 = (((*__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_2 = __pyx_t_3;
          __pyx_L13_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10683
 *                 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_L12;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":10685
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":10686
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_6 = __pyx_v_i;
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":10687
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L15;
            }
            __pyx_L15:;
          }
          __pyx_L12:;
          goto __pyx_L11;
        }

        /* "pandas/src/generated.pyx":10688
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":10689
 *                             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":10690
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_7 = __pyx_v_j;
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10691
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L16;
          }
          __pyx_L16:;
          goto __pyx_L11;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":10694
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L7_break;
        }
        __pyx_L11:;
        goto __pyx_L10;
      }

      /* "pandas/src/generated.pyx":10695
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10696
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":10698
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     # do it again now that result size is known
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L10:;
    }
    __pyx_L7_break:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":10702
 *     # 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_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __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 = 10702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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 = 10702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10702; __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_10, __pyx_t_8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10702; __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_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 10702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":10703
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.float64)
 * 
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __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 = 10703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10703; __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 = 10703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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[2]; __pyx_lineno = 10703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
      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_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      }
    }
    __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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "pandas/src/generated.pyx":10704
 *     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_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_empty); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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[2]; __pyx_lineno = 10704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_9);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_18 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/generated.pyx":10706
 *     result = np.empty(count, dtype=np.float64)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10707
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10708
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10709
 *     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) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L18_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_nright > 0) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L18_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10710
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":10711
 *     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":10712
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10713
 *             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":10714
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10716
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":10717
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 lindexer[count] = i
 */
      __pyx_t_20 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":10718
 *             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":10719
 *             rval = right[j]
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_21 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":10720
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_22 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":10721
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_23 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval;

        /* "pandas/src/generated.pyx":10722
 *                 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":10723
 *                 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":10724
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_3) {
          } else {
            __pyx_t_2 = __pyx_t_3;
            goto __pyx_L27_bool_binop_done;
          }
          __pyx_t_24 = (__pyx_v_j + 1);
          __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
          __pyx_t_2 = __pyx_t_3;
          __pyx_L27_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10725
 *                 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_L26;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":10727
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":10728
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_25 = __pyx_v_i;
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":10729
 *                         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_L26:;
          goto __pyx_L25;
        }

        /* "pandas/src/generated.pyx":10730
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":10731
 *                             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":10732
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_26 = __pyx_v_j;
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10733
 *                     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_L25;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":10736
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L21_break;
        }
        __pyx_L25:;
        goto __pyx_L24;
      }

      /* "pandas/src/generated.pyx":10737
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10738
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L24;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":10740
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L24:;
    }
    __pyx_L21_break:;
    goto __pyx_L17;
  }
  __pyx_L17:;

  /* "pandas/src/generated.pyx":10742
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":10653
 * @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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":10746
 * @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_525inner_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_524inner_join_indexer_float32[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_525inner_join_indexer_float32 = {"inner_join_indexer_float32", (PyCFunction)__pyx_pw_6pandas_5algos_525inner_join_indexer_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_524inner_join_indexer_float32};
static PyObject *__pyx_pw_6pandas_5algos_525inner_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 = 10746; __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 = 10746; __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 = 10746; __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 = 10746; __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 = 10747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_524inner_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_524inner_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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  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;
  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 = 10746; __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 = 10746; __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":10757
 *         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 = 10757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":10758
 * 
 *     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 = 10758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":10760
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10761
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10762
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10763
 *     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) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_nright > 0) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10764
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":10765
 *     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":10766
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L7_break;
      }

      /* "pandas/src/generated.pyx":10767
 *             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":10768
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L7_break;
      }

      /* "pandas/src/generated.pyx":10770
 *                 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":10771
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 count += 1
 */
      __pyx_t_4 = __pyx_v_j;
      __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":10772
 *             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":10773
 *             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":10774
 *             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":10775
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_3) {
          } else {
            __pyx_t_2 = __pyx_t_3;
            goto __pyx_L13_bool_binop_done;
          }
          __pyx_t_5 = (__pyx_v_j + 1);
          __pyx_t_3 = (((*__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_2 = __pyx_t_3;
          __pyx_L13_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10776
 *                 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_L12;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":10778
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":10779
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_6 = __pyx_v_i;
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":10780
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L15;
            }
            __pyx_L15:;
          }
          __pyx_L12:;
          goto __pyx_L11;
        }

        /* "pandas/src/generated.pyx":10781
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":10782
 *                             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":10783
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_7 = __pyx_v_j;
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10784
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L16;
          }
          __pyx_L16:;
          goto __pyx_L11;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":10787
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L7_break;
        }
        __pyx_L11:;
        goto __pyx_L10;
      }

      /* "pandas/src/generated.pyx":10788
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10789
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":10791
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     # do it again now that result size is known
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L10:;
    }
    __pyx_L7_break:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":10795
 *     # 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_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __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 = 10795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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 = 10795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10795; __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_10, __pyx_t_8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10795; __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_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 10795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":10796
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.float32)
 * 
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __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 = 10796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10796; __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 = 10796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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[2]; __pyx_lineno = 10796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
      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_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      }
    }
    __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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "pandas/src/generated.pyx":10797
 *     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_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_empty); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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[2]; __pyx_lineno = 10797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float32); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_9);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_18 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/generated.pyx":10799
 *     result = np.empty(count, dtype=np.float32)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10800
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10801
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10802
 *     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) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L18_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_nright > 0) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L18_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10803
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":10804
 *     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":10805
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10806
 *             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":10807
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10809
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":10810
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 lindexer[count] = i
 */
      __pyx_t_20 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":10811
 *             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":10812
 *             rval = right[j]
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_21 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":10813
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_22 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":10814
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_23 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval;

        /* "pandas/src/generated.pyx":10815
 *                 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":10816
 *                 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":10817
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_3) {
          } else {
            __pyx_t_2 = __pyx_t_3;
            goto __pyx_L27_bool_binop_done;
          }
          __pyx_t_24 = (__pyx_v_j + 1);
          __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
          __pyx_t_2 = __pyx_t_3;
          __pyx_L27_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10818
 *                 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_L26;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":10820
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":10821
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_25 = __pyx_v_i;
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":10822
 *                         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_L26:;
          goto __pyx_L25;
        }

        /* "pandas/src/generated.pyx":10823
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":10824
 *                             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":10825
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_26 = __pyx_v_j;
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10826
 *                     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_L25;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":10829
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L21_break;
        }
        __pyx_L25:;
        goto __pyx_L24;
      }

      /* "pandas/src/generated.pyx":10830
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10831
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L24;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":10833
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L24:;
    }
    __pyx_L21_break:;
    goto __pyx_L17;
  }
  __pyx_L17:;

  /* "pandas/src/generated.pyx":10835
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":10746
 * @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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":10839
 * @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_527inner_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_526inner_join_indexer_object[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_527inner_join_indexer_object = {"inner_join_indexer_object", (PyCFunction)__pyx_pw_6pandas_5algos_527inner_join_indexer_object, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_526inner_join_indexer_object};
static PyObject *__pyx_pw_6pandas_5algos_527inner_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 = 10839; __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 = 10839; __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 = 10839; __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 = 10839; __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 = 10840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_526inner_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_526inner_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;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __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;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  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;
  PyObject **__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_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 = 10839; __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 = 10839; __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":10850
 *         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 = 10850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":10851
 * 
 *     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 = 10851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":10853
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10854
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10855
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10856
 *     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) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_nright > 0) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10857
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":10858
 *     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":10859
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L7_break;
      }

      /* "pandas/src/generated.pyx":10860
 *             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":10861
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L7_break;
      }

      /* "pandas/src/generated.pyx":10863
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_1 = __pyx_v_i;
      __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pandas/src/generated.pyx":10864
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 count += 1
 */
      __pyx_t_5 = __pyx_v_j;
      __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides);
      __Pyx_INCREF((PyObject*)__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pandas/src/generated.pyx":10865
 *             lval = left[i]
 *             rval = right[j]
 *             if lval == rval:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10866
 *             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":10867
 *             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":10868
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_3) {
          } else {
            __pyx_t_2 = __pyx_t_3;
            goto __pyx_L13_bool_binop_done;
          }
          __pyx_t_6 = (__pyx_v_j + 1);
          __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_4);
          __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_2 = __pyx_t_3;
          __pyx_L13_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10869
 *                 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_L12;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":10871
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":10872
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_8 = __pyx_v_i;
            __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_left.diminfo[0].strides);
            __Pyx_INCREF((PyObject*)__pyx_t_7);
            __pyx_t_4 = PyObject_RichCompare(__pyx_t_7, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":10873
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L15;
            }
            __pyx_L15:;
          }
          __pyx_L12:;
          goto __pyx_L11;
        }

        /* "pandas/src/generated.pyx":10874
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":10875
 *                             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":10876
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_9 = __pyx_v_j;
          __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_right.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_4);
          __pyx_t_7 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10877
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L16;
          }
          __pyx_L16:;
          goto __pyx_L11;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":10880
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L7_break;
        }
        __pyx_L11:;
        goto __pyx_L10;
      }

      /* "pandas/src/generated.pyx":10881
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __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 = 10881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10882
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":10884
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     # do it again now that result size is known
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L10:;
    }
    __pyx_L7_break:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":10888
 *     # 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 = 10888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __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 = 10888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10888; __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);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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 = 10888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":10889
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=object)
 * 
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __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 = 10889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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[2]; __pyx_lineno = 10889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
      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_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      }
    }
    __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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "pandas/src/generated.pyx":10890
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)
 *     result = np.empty(count, dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_empty); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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[2]; __pyx_lineno = 10890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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 = 10890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_18 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "pandas/src/generated.pyx":10892
 *     result = np.empty(count, dtype=object)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10893
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10894
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10895
 *     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) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L18_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_nright > 0) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L18_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10896
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":10897
 *     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":10898
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10899
 *             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":10900
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10902
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_19, __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":10903
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 lindexer[count] = i
 */
      __pyx_t_20 = __pyx_v_j;
      __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_20, __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":10904
 *             lval = left[i]
 *             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 = 10904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10905
 *             rval = right[j]
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_21 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":10906
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_22 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":10907
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_23 = __pyx_v_count;
        __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_v_rval); __Pyx_DECREF(*__pyx_t_24);
        *__pyx_t_24 = __pyx_v_rval;
        __Pyx_GIVEREF(*__pyx_t_24);

        /* "pandas/src/generated.pyx":10908
 *                 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":10909
 *                 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":10910
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_3) {
          } else {
            __pyx_t_2 = __pyx_t_3;
            goto __pyx_L27_bool_binop_done;
          }
          __pyx_t_25 = (__pyx_v_j + 1);
          __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_7);
          __pyx_t_11 = PyObject_RichCompare(__pyx_t_7, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_2 = __pyx_t_3;
          __pyx_L27_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10911
 *                 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_L26;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":10913
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":10914
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_26 = __pyx_v_i;
            __pyx_t_11 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left.diminfo[0].strides);
            __Pyx_INCREF((PyObject*)__pyx_t_11);
            __pyx_t_7 = PyObject_RichCompare(__pyx_t_11, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":10915
 *                         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_L26:;
          goto __pyx_L25;
        }

        /* "pandas/src/generated.pyx":10916
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":10917
 *                             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":10918
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_27 = __pyx_v_j;
          __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right.diminfo[0].strides);
          __Pyx_INCREF((PyObject*)__pyx_t_7);
          __pyx_t_11 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10919
 *                     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_L25;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":10922
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L21_break;
        }
        __pyx_L25:;
        goto __pyx_L24;
      }

      /* "pandas/src/generated.pyx":10923
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_11 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10924
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L24;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":10926
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L24:;
    }
    __pyx_L21_break:;
    goto __pyx_L17;
  }
  __pyx_L17:;

  /* "pandas/src/generated.pyx":10928
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10928; __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":10839
 * @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_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":10932
 * @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_529inner_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_528inner_join_indexer_int32[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_529inner_join_indexer_int32 = {"inner_join_indexer_int32", (PyCFunction)__pyx_pw_6pandas_5algos_529inner_join_indexer_int32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_528inner_join_indexer_int32};
static PyObject *__pyx_pw_6pandas_5algos_529inner_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 = 10932; __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 = 10932; __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 = 10932; __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 = 10932; __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 = 10933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_528inner_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_528inner_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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  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;
  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 = 10932; __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 = 10932; __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":10943
 *         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 = 10943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":10944
 * 
 *     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 = 10944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":10946
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10947
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10948
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10949
 *     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) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_nright > 0) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10950
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":10951
 *     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":10952
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L7_break;
      }

      /* "pandas/src/generated.pyx":10953
 *             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":10954
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L7_break;
      }

      /* "pandas/src/generated.pyx":10956
 *                 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":10957
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 count += 1
 */
      __pyx_t_4 = __pyx_v_j;
      __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":10958
 *             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":10959
 *             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":10960
 *             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":10961
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_3) {
          } else {
            __pyx_t_2 = __pyx_t_3;
            goto __pyx_L13_bool_binop_done;
          }
          __pyx_t_5 = (__pyx_v_j + 1);
          __pyx_t_3 = (((*__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_2 = __pyx_t_3;
          __pyx_L13_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10962
 *                 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_L12;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":10964
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":10965
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_6 = __pyx_v_i;
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":10966
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L15;
            }
            __pyx_L15:;
          }
          __pyx_L12:;
          goto __pyx_L11;
        }

        /* "pandas/src/generated.pyx":10967
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":10968
 *                             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":10969
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_7 = __pyx_v_j;
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":10970
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L16;
          }
          __pyx_L16:;
          goto __pyx_L11;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":10973
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L7_break;
        }
        __pyx_L11:;
        goto __pyx_L10;
      }

      /* "pandas/src/generated.pyx":10974
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":10975
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":10977
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     # do it again now that result size is known
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L10:;
    }
    __pyx_L7_break:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":10981
 *     # 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_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __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 = 10981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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 = 10981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10981; __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_10, __pyx_t_8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10981; __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_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 10981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":10982
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.int32)
 * 
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __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 = 10982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10982; __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 = 10982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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[2]; __pyx_lineno = 10982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
      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_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      }
    }
    __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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "pandas/src/generated.pyx":10983
 *     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_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_empty); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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[2]; __pyx_lineno = 10983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int32); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_9);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_18 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/generated.pyx":10985
 *     result = np.empty(count, dtype=np.int32)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":10986
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":10987
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":10988
 *     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) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L18_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_nright > 0) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L18_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":10989
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":10990
 *     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":10991
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10992
 *             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":10993
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":10995
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":10996
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 lindexer[count] = i
 */
      __pyx_t_20 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":10997
 *             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":10998
 *             rval = right[j]
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_21 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":10999
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_22 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":11000
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_23 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval;

        /* "pandas/src/generated.pyx":11001
 *                 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":11002
 *                 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":11003
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_3) {
          } else {
            __pyx_t_2 = __pyx_t_3;
            goto __pyx_L27_bool_binop_done;
          }
          __pyx_t_24 = (__pyx_v_j + 1);
          __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
          __pyx_t_2 = __pyx_t_3;
          __pyx_L27_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":11004
 *                 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_L26;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":11006
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":11007
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_25 = __pyx_v_i;
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":11008
 *                         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_L26:;
          goto __pyx_L25;
        }

        /* "pandas/src/generated.pyx":11009
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":11010
 *                             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":11011
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_26 = __pyx_v_j;
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":11012
 *                     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_L25;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":11015
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L21_break;
        }
        __pyx_L25:;
        goto __pyx_L24;
      }

      /* "pandas/src/generated.pyx":11016
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":11017
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L24;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":11019
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L24:;
    }
    __pyx_L21_break:;
    goto __pyx_L17;
  }
  __pyx_L17:;

  /* "pandas/src/generated.pyx":11021
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":10932
 * @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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":11025
 * @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_531inner_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_5algos_530inner_join_indexer_int64[] = "\n    Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n    ";
static PyMethodDef __pyx_mdef_6pandas_5algos_531inner_join_indexer_int64 = {"inner_join_indexer_int64", (PyCFunction)__pyx_pw_6pandas_5algos_531inner_join_indexer_int64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5algos_530inner_join_indexer_int64};
static PyObject *__pyx_pw_6pandas_5algos_531inner_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 = 11025; __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 = 11025; __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 = 11025; __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 = 11025; __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 = 11026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_5algos_530inner_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_530inner_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;
  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;
  PyObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  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;
  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 = 11025; __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 = 11025; __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":11036
 *         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 = 11036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "pandas/src/generated.pyx":11037
 * 
 *     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 = 11037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "pandas/src/generated.pyx":11039
 *     nright = len(right)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":11040
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":11041
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":11042
 *     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) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_nright > 0) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":11043
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":11044
 *     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":11045
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L7_break;
      }

      /* "pandas/src/generated.pyx":11046
 *             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":11047
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L7_break;
      }

      /* "pandas/src/generated.pyx":11049
 *                 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":11050
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 count += 1
 */
      __pyx_t_4 = __pyx_v_j;
      __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":11051
 *             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":11052
 *             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":11053
 *             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":11054
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_3) {
          } else {
            __pyx_t_2 = __pyx_t_3;
            goto __pyx_L13_bool_binop_done;
          }
          __pyx_t_5 = (__pyx_v_j + 1);
          __pyx_t_3 = (((*__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_2 = __pyx_t_3;
          __pyx_L13_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":11055
 *                 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_L12;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":11057
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":11058
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_6 = __pyx_v_i;
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":11059
 *                         i += 1
 *                         if left[i] != rval:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                 elif j < nright - 1:
 *                     j += 1
 */
              __pyx_v_j = (__pyx_v_j + 1);
              goto __pyx_L15;
            }
            __pyx_L15:;
          }
          __pyx_L12:;
          goto __pyx_L11;
        }

        /* "pandas/src/generated.pyx":11060
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":11061
 *                             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":11062
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_7 = __pyx_v_j;
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":11063
 *                     j += 1
 *                     if lval != right[j]:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # end of the road
 */
            __pyx_v_i = (__pyx_v_i + 1);
            goto __pyx_L16;
          }
          __pyx_L16:;
          goto __pyx_L11;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":11066
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L7_break;
        }
        __pyx_L11:;
        goto __pyx_L10;
      }

      /* "pandas/src/generated.pyx":11067
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":11068
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":11070
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     # do it again now that result size is known
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L10:;
    }
    __pyx_L7_break:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pandas/src/generated.pyx":11074
 *     # 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_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __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 = 11074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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 = 11074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11074; __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_10, __pyx_t_8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11074; __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_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 11074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "pandas/src/generated.pyx":11075
 * 
 *     lindexer = np.empty(count, dtype=np.int64)
 *     rindexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result = np.empty(count, dtype=np.int64)
 * 
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __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 = 11075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11075; __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 = 11075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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[2]; __pyx_lineno = 11075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
      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_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      }
    }
    __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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "pandas/src/generated.pyx":11076
 *     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_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_empty); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 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[2]; __pyx_lineno = 11076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_9);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_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_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_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_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_18 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/generated.pyx":11078
 *     result = np.empty(count, dtype=np.int64)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     count = 0
 */
  __pyx_v_i = 0;

  /* "pandas/src/generated.pyx":11079
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     count = 0
 *     if nleft > 0 and nright > 0:
 */
  __pyx_v_j = 0;

  /* "pandas/src/generated.pyx":11080
 *     i = 0
 *     j = 0
 *     count = 0             # <<<<<<<<<<<<<<
 *     if nleft > 0 and nright > 0:
 *         while True:
 */
  __pyx_v_count = 0;

  /* "pandas/src/generated.pyx":11081
 *     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) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L18_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_nright > 0) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L18_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pandas/src/generated.pyx":11082
 *     count = 0
 *     if nleft > 0 and nright > 0:
 *         while True:             # <<<<<<<<<<<<<<
 *             if i == nleft:
 *                 break
 */
    while (1) {

      /* "pandas/src/generated.pyx":11083
 *     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":11084
 *         while True:
 *             if i == nleft:
 *                 break             # <<<<<<<<<<<<<<
 *             if j == nright:
 *                 break
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":11085
 *             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":11086
 *                 break
 *             if j == nright:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             lval = left[i]
 */
        goto __pyx_L21_break;
      }

      /* "pandas/src/generated.pyx":11088
 *                 break
 * 
 *             lval = left[i]             # <<<<<<<<<<<<<<
 *             rval = right[j]
 *             if lval == rval:
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_left.diminfo[0].strides));

      /* "pandas/src/generated.pyx":11089
 * 
 *             lval = left[i]
 *             rval = right[j]             # <<<<<<<<<<<<<<
 *             if lval == rval:
 *                 lindexer[count] = i
 */
      __pyx_t_20 = __pyx_v_j;
      __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_right.diminfo[0].strides));

      /* "pandas/src/generated.pyx":11090
 *             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":11091
 *             rval = right[j]
 *             if lval == rval:
 *                 lindexer[count] = i             # <<<<<<<<<<<<<<
 *                 rindexer[count] = j
 *                 result[count] = rval
 */
        __pyx_t_21 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i;

        /* "pandas/src/generated.pyx":11092
 *             if lval == rval:
 *                 lindexer[count] = i
 *                 rindexer[count] = j             # <<<<<<<<<<<<<<
 *                 result[count] = rval
 *                 count += 1
 */
        __pyx_t_22 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j;

        /* "pandas/src/generated.pyx":11093
 *                 lindexer[count] = i
 *                 rindexer[count] = j
 *                 result[count] = rval             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 if i < nleft - 1:
 */
        __pyx_t_23 = __pyx_v_count;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval;

        /* "pandas/src/generated.pyx":11094
 *                 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":11095
 *                 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":11096
 *                 count += 1
 *                 if i < nleft - 1:
 *                     if j < nright - 1 and right[j + 1] == rval:             # <<<<<<<<<<<<<<
 *                         j += 1
 *                     else:
 */
          __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
          if (__pyx_t_3) {
          } else {
            __pyx_t_2 = __pyx_t_3;
            goto __pyx_L27_bool_binop_done;
          }
          __pyx_t_24 = (__pyx_v_j + 1);
          __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0);
          __pyx_t_2 = __pyx_t_3;
          __pyx_L27_bool_binop_done:;
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":11097
 *                 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_L26;
          }
          /*else*/ {

            /* "pandas/src/generated.pyx":11099
 *                         j += 1
 *                     else:
 *                         i += 1             # <<<<<<<<<<<<<<
 *                         if left[i] != rval:
 *                             j += 1
 */
            __pyx_v_i = (__pyx_v_i + 1);

            /* "pandas/src/generated.pyx":11100
 *                     else:
 *                         i += 1
 *                         if left[i] != rval:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                 elif j < nright - 1:
 */
            __pyx_t_25 = __pyx_v_i;
            __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0);
            if (__pyx_t_2) {

              /* "pandas/src/generated.pyx":11101
 *                         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_L26:;
          goto __pyx_L25;
        }

        /* "pandas/src/generated.pyx":11102
 *                         if left[i] != rval:
 *                             j += 1
 *                 elif j < nright - 1:             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     if lval != right[j]:
 */
        __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0);
        if (__pyx_t_2) {

          /* "pandas/src/generated.pyx":11103
 *                             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":11104
 *                 elif j < nright - 1:
 *                     j += 1
 *                     if lval != right[j]:             # <<<<<<<<<<<<<<
 *                         i += 1
 *                 else:
 */
          __pyx_t_26 = __pyx_v_j;
          __pyx_t_2 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_right.diminfo[0].strides))) != 0);
          if (__pyx_t_2) {

            /* "pandas/src/generated.pyx":11105
 *                     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_L25;
        }
        /*else*/ {

          /* "pandas/src/generated.pyx":11108
 *                 else:
 *                     # end of the road
 *                     break             # <<<<<<<<<<<<<<
 *             elif lval < rval:
 *                 i += 1
 */
          goto __pyx_L21_break;
        }
        __pyx_L25:;
        goto __pyx_L24;
      }

      /* "pandas/src/generated.pyx":11109
 *                     # end of the road
 *                     break
 *             elif lval < rval:             # <<<<<<<<<<<<<<
 *                 i += 1
 *             else:
 */
      __pyx_t_2 = ((__pyx_v_lval < __pyx_v_rval) != 0);
      if (__pyx_t_2) {

        /* "pandas/src/generated.pyx":11110
 *                     break
 *             elif lval < rval:
 *                 i += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 j += 1
 */
        __pyx_v_i = (__pyx_v_i + 1);
        goto __pyx_L24;
      }
      /*else*/ {

        /* "pandas/src/generated.pyx":11112
 *                 i += 1
 *             else:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, lindexer, rindexer
 */
        __pyx_v_j = (__pyx_v_j + 1);
      }
      __pyx_L24:;
    }
    __pyx_L21_break:;
    goto __pyx_L17;
  }
  __pyx_L17:;

  /* "pandas/src/generated.pyx":11114
 *                 j += 1
 * 
 *     return result, lindexer, rindexer             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_lindexer));
  PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_lindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_rindexer));
  PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_v_rindexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer));
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pandas/src/generated.pyx":11025
 * @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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_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":127
 * 
 * 
 * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts,             # <<<<<<<<<<<<<<
 *                            int* out_local, int* out_tzoffset):
 *     cdef int result
 */

static CYTHON_INLINE PyObject *__pyx_f_8datetime__string_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts, int *__pyx_v_out_local, int *__pyx_v_out_tzoffset) {
  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":132
 *     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":133
 * 
 *     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 = 133; __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":135
 *         val = PyUnicode_AsASCIIString(val);
 * 
 *     tmp = val             # <<<<<<<<<<<<<<
 *     result = _cstring_to_dts(tmp, len(val), dts, out_local, out_tzoffset)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_val); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_tmp = __pyx_t_3;

  /* "datetime.pxd":136
 * 
 *     tmp = val
 *     result = _cstring_to_dts(tmp, len(val), dts, out_local, out_tzoffset)             # <<<<<<<<<<<<<<
 * 
 *     if result == -1:
 */
  __pyx_t_4 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 136; __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, __pyx_v_out_local, __pyx_v_out_tzoffset);

  /* "datetime.pxd":138
 *     result = _cstring_to_dts(tmp, len(val), dts, out_local, out_tzoffset)
 * 
 *     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":139
 * 
 *     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 = 139; __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 = 139; __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 = 139; __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 = 139; __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 = 139; __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 = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "datetime.pxd":127
 * 
 * 
 * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts,             # <<<<<<<<<<<<<<
 *                            int* out_local, int* out_tzoffset):
 *     cdef int result
 */

  /* 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":141
 *         raise ValueError('Unable to parse %s' % str(val))
 * 
 * cdef inline int _cstring_to_dts(char *val, int length,             # <<<<<<<<<<<<<<
 *                                 pandas_datetimestruct* dts,
 *                                 int* out_local, int* out_tzoffset):
 */

static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *__pyx_v_val, int __pyx_v_length, pandas_datetimestruct *__pyx_v_dts, int *__pyx_v_out_local, int *__pyx_v_out_tzoffset) {
  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":149
 *         int result
 * 
 *     result = parse_iso_8601_datetime(val, length, PANDAS_FR_ns,             # <<<<<<<<<<<<<<
 *                                      NPY_UNSAFE_CASTING,
 *                                      dts, out_local, out_tzoffset, &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_out_local, __pyx_v_out_tzoffset, (&__pyx_v_out_bestunit), (&__pyx_v_special));

  /* "datetime.pxd":152
 *                                      NPY_UNSAFE_CASTING,
 *                                      dts, out_local, out_tzoffset, &out_bestunit, &special)
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "datetime.pxd":141
 *         raise ValueError('Unable to parse %s' % str(val))
 * 
 * cdef inline int _cstring_to_dts(char *val, int length,             # <<<<<<<<<<<<<<
 *                                 pandas_datetimestruct* dts,
 *                                 int* out_local, int* out_tzoffset):
 */

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

/* "datetime.pxd":155
 * 
 * 
 * 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":157
 * 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":158
 *     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 = 158; __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":155
 * 
 * 
 * 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":160
 *     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":161
 * 
 * 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":163
 *     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 = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "datetime.pxd":161
 * 
 * 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":160
 *     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":165
 *                                                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":166
 * 
 * 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 = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val));

  /* "datetime.pxd":167
 * 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 = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val));

  /* "datetime.pxd":168
 *     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 = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val));

  /* "datetime.pxd":169
 *     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":170
 *     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":171
 *     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":172
 *     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":173
 *     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":174
 *     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":165
 *                                                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":176
 *     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":178
 * 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 = 178; __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 = 178; __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":179
 *                                           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 = 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->month = __pyx_t_3;

  /* "datetime.pxd":180
 *     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 = 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->day = __pyx_t_3;

  /* "datetime.pxd":181
 *     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 = 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->hour = __pyx_t_3;

  /* "datetime.pxd":182
 *     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 = 182; __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 = 182; __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":183
 *     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 = 183; __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 = 183; __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":184
 *     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 = 184; __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 = 184; __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":185
 *     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":186
 *     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":176
 *     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":188
 *     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":190
 * 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 = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val));

  /* "datetime.pxd":191
 *                                         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 = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val));

  /* "datetime.pxd":192
 *     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 = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val));

  /* "datetime.pxd":193
 *     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":194
 *     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":195
 *     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":188
 *     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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  char *__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);
  }

  /* "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_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }

  /* "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_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_1) {

    /* "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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__291, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 217; __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 = 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_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L9_bool_binop_done;
  }

  /* "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_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_1) {

    /* "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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__292, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __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 = 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_1 = (__pyx_v_copy_shape != 0);
  if (__pyx_t_1) {

    /* "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_4 = __pyx_v_ndim;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

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

  /* "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_3 = ((PyObject *)__pyx_v_self->descr);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
  __pyx_t_3 = 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) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L15_bool_binop_done:;
  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_L14;
  }
  /*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_L14:;

  /* "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_4 = __pyx_v_descr->type_num;
    __pyx_v_t = __pyx_t_4;

    /* "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_2 = ((__pyx_v_descr->byteorder == '>') != 0);
    if (!__pyx_t_2) {
      goto __pyx_L20_next_or;
    } else {
    }
    __pyx_t_2 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_L20_next_or:;

    /* "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_2 = ((__pyx_v_descr->byteorder == '<') != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L19_bool_binop_done:;
    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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__293, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 259; __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 = 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_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_7 = __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_7 == NULL)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_f = __pyx_t_7;

    /* "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_3);
  __Pyx_XDECREF(__pyx_t_6);
  __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;
  long __pyx_t_8;
  char *__pyx_t_9;
  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__294, 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_7 = ((__pyx_v_child->byteorder == '>') != 0);
    if (!__pyx_t_7) {
      goto __pyx_L8_next_or;
    } else {
    }
    __pyx_t_7 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_L8_next_or:;

    /* "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_7 = ((__pyx_v_child->byteorder == '<') != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;
    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__295, 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_8 = 0;
      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
    }

    /* "numpy.pxd":822
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    __pyx_t_8 = 0;
    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __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__296, 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_L15;
      }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      /* "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_L13;
    }
    /*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_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_f = __pyx_t_9;
    }
    __pyx_L13:;

    /* "numpy.pxd":798
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  }
  __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":27
 *     inline object unbox_if_zerodim(object arr)
 * 
 * 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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value_at", 0);
  __Pyx_INCREF(__pyx_v_loc);

  /* "util.pxd":31
 *         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":32
 *         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 = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_casted = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "util.pxd":33
 *     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 = 33; __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 = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "util.pxd":34
 *         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":35
 *         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 = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_i = ((Py_ssize_t)__pyx_t_3);

  /* "util.pxd":36
 *             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":38
 *     sz = cnp.PyArray_SIZE(arr)
 * 
 *     if i < 0 and sz > 0:             # <<<<<<<<<<<<<<
 *         i += sz
 *     elif i >= sz or sz == 0:
 */
  __pyx_t_4 = ((__pyx_v_i < 0) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_sz > 0) != 0);
  __pyx_t_1 = __pyx_t_4;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_1) {

    /* "util.pxd":39
 * 
 *     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":40
 *     if i < 0 and sz > 0:
 *         i += sz
 *     elif i >= sz or sz == 0:             # <<<<<<<<<<<<<<
 *         raise IndexError('index out of bounds')
 * 
 */
  __pyx_t_4 = ((__pyx_v_i >= __pyx_v_sz) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_sz == 0) != 0);
  __pyx_t_1 = __pyx_t_4;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_1) {

    /* "util.pxd":41
 *         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__297, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 41; __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 = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L5:;

  /* "util.pxd":43
 *         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 = 43; __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":27
 *     inline object unbox_if_zerodim(object arr)
 * 
 * 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":45
 *     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":48
 *     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":49
 *         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 = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_casted = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "util.pxd":50
 *     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 = 50; __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 = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "util.pxd":51
 *         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":52
 *         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 = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_i = ((Py_ssize_t)__pyx_t_3);

  /* "util.pxd":53
 *             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":55
 *     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":56
 * 
 *     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":57
 *     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":58
 *         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__298, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 58; __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 = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L5:;

  /* "util.pxd":60
 *         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 = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "util.pxd":45
 *     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":62
 *     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":63
 * 
 * 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":62
 *     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":65
 *     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":66
 * 
 * cdef inline is_array(object o):
 *     return cnp.PyArray_Check(o)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint _checknull(object val):
 */
  __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 = 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;

  /* "util.pxd":65
 *     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
 *     return cnp.PyArray_Check(o)
 * 
 * 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;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __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("_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_5 = (__pyx_v_val == Py_None);
      __pyx_t_6 = (__pyx_t_5 != 0);
      if (!__pyx_t_6) {
      } else {
        __pyx_t_4 = __pyx_t_6;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_6 = (PyFloat_Check(__pyx_v_val) != 0);
      if (__pyx_t_6) {
      } else {
        __pyx_t_4 = __pyx_t_6;
        goto __pyx_L11_bool_binop_done;
      }
      __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_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_4 = __pyx_t_6;
      __pyx_L11_bool_binop_done:;
      __pyx_r = __pyx_t_4;
      goto __pyx_L7_try_return;
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "util.pxd":71
 *     try:
 *         return val is None or (cpython.PyFloat_Check(val) and val != val)
 *     except ValueError:             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
    __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_9, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GOTREF(__pyx_t_10);

      /* "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_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L6_except_return;
    }
    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;
  }

  /* "util.pxd":68
 *     return cnp.PyArray_Check(o)
 * 
 * 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_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __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;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = 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 val is None or (cpython.PyFloat_Check(val) and (val != val or val == INF or val == NEGINF))
 */
  __pyx_v_NEGINF = (-__pyx_v_INF);

  /* "util.pxd":78
 *     cdef double INF = <double> np.inf
 *     cdef double NEGINF = -INF
 *     try:             # <<<<<<<<<<<<<<
 *         return val is None or (cpython.PyFloat_Check(val) and (val != val or val == INF or val == NEGINF))
 *     except ValueError:
 */
  {
    __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 val is None or (cpython.PyFloat_Check(val) and (val != val or val == INF or val == NEGINF))             # <<<<<<<<<<<<<<
 *     except ValueError:
 *         return False
 */
      __pyx_t_7 = (__pyx_v_val == Py_None);
      __pyx_t_8 = (__pyx_t_7 != 0);
      if (!__pyx_t_8) {
      } else {
        __pyx_t_6 = __pyx_t_8;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_8 = (PyFloat_Check(__pyx_v_val) != 0);
      if (__pyx_t_8) {
      } else {
        __pyx_t_6 = __pyx_t_8;
        goto __pyx_L11_bool_binop_done;
      }
      __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_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 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_8) {
      } else {
        __pyx_t_6 = __pyx_t_8;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_1 = PyFloat_FromDouble(__pyx_v_INF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = PyObject_RichCompare(__pyx_v_val, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (!__pyx_t_8) {
      } else {
        __pyx_t_6 = __pyx_t_8;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_9 = PyFloat_FromDouble(__pyx_v_NEGINF); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_val, __pyx_t_9, Py_EQ); __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_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 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;
      __pyx_t_6 = __pyx_t_8;
      __pyx_L11_bool_binop_done:;
      __pyx_r = __pyx_t_6;
      goto __pyx_L7_try_return;
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "util.pxd":80
 *     try:
 *         return val is None or (cpython.PyFloat_Check(val) and (val != val or val == INF or val == NEGINF))
 *     except ValueError:             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
    __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_10) {
      __Pyx_AddTraceback("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_9, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GOTREF(__pyx_t_11);

      /* "util.pxd":81
 *         return val is None or (cpython.PyFloat_Check(val) and (val != val or val == INF or 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_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L6_except_return;
    }
    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;
  }

  /* "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_9);
  __Pyx_XDECREF(__pyx_t_11);
  __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":83
 *         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
  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("_checknan", 0);

  /* "util.pxd":84
 * 
 * cdef inline bint _checknan(object val):
 *     return not cnp.PyArray_Check(val) and val != val             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_period_object(object val):
 */
  __pyx_t_2 = ((!(PyArray_Check(__pyx_v_val) != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L3_bool_binop_done;
  }
  __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 = 84; __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[6]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "util.pxd":83
 *         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_3);
  __Pyx_WriteUnraisable("util._checknan", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "util.pxd":86
 *     return not cnp.PyArray_Check(val) and val != val
 * 
 * cdef inline bint is_period_object(object val):             # <<<<<<<<<<<<<<
 *     return getattr(val,'_typ','_typ') == 'period'
 */

static CYTHON_INLINE int __pyx_f_4util_is_period_object(PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_period_object", 0);

  /* "util.pxd":87
 * 
 * cdef inline bint is_period_object(object val):
 *     return getattr(val,'_typ','_typ') == 'period'             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_val, __pyx_n_s_typ, __pyx_n_s_typ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_n_s_period, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  goto __pyx_L0;

  /* "util.pxd":86
 *     return not cnp.PyArray_Check(val) and val != val
 * 
 * cdef inline bint is_period_object(object val):             # <<<<<<<<<<<<<<
 *     return getattr(val,'_typ','_typ') == 'period'
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("util.is_period_object", __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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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__299, 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__300, 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__301, 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;

    /* "View.MemoryView":145
 * 
 * 
 *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
 *             if dim <= 0:
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, 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__302, 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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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__303, 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___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));

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

static void __pyx_array___pyx_pf_15View_dot_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 = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));

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

static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)((PyObject *)__pyx_memoryview_type)));
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_obj != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "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_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
    if (__pyx_t_1) {

      /* "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_L6;
    }
    __pyx_L6:;
    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_1 = ((__pyx_v_self->lock == NULL) != 0);
  if (__pyx_t_1) {

    /* "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_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {

    /* "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_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 == (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_1;
    goto __pyx_L8;
  }
  /*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_L8:;

  /* "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___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static void __pyx_memoryview___pyx_pf_15View_dot_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 (likely(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; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(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_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;

    /* "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_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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;
      }
      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_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;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); 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 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); 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);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_8 = 1;
        }
      }
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
      }
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_bytesitem);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
      __Pyx_GIVEREF(__pyx_v_bytesitem);
      __pyx_t_6 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); 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_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_result = __pyx_t_1;
      __pyx_t_1 = 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_10 = strlen(__pyx_v_self->view.format); 
      __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
      if (__pyx_t_11) {

        /* "View.MemoryView":448
 *         else:
 *             if len(self.view.format) == 1:
 *                 return result[0]             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;};
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 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_L3_error:;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = PyErr_ExceptionMatches(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_12) {
      __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_9);

      /* "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_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__304, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
    }
    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;
  }

  /* "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_7);
  __Pyx_XDECREF(__pyx_t_9);
  __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;
  PyObject *__pyx_t_9 = NULL;
  char *__pyx_t_10;
  char *__pyx_t_11;
  char *__pyx_t_12;
  char *__pyx_t_13;
  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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); 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 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); 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);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_5) {
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); 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_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 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_9 = __pyx_v_bytesvalue;
  __pyx_t_11 = PyBytes_AS_STRING(__pyx_t_9);
  __pyx_t_12 = (__pyx_t_11 + PyBytes_GET_SIZE(__pyx_t_9));
  for (__pyx_t_13 = __pyx_t_11; __pyx_t_13 < __pyx_t_12; __pyx_t_13++) {
    __pyx_t_10 = __pyx_t_13;
    __pyx_v_c = (__pyx_t_10[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_9); __pyx_t_9 = 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_XDECREF(__pyx_t_9);
  __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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_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_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_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([length for length in self.view.shape[: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_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_v_length;
  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("__get__", 0);

  /* "View.MemoryView":514
 *         @cname('__pyx_memoryview_get_shape')
 *         def __get__(self):
 *             return tuple([length for length in self.view.shape[: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_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
    __pyx_t_2 = __pyx_t_4;
    __pyx_v_length = (__pyx_t_2[0]);
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __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;

  /* "View.MemoryView":513
 *     property shape:
 *         @cname('__pyx_memoryview_get_shape')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return tuple([length for length in self.view.shape[:self.view.ndim]])
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __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_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_v_stride;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  Py_ssize_t *__pyx_t_5;
  PyObject *__pyx_t_6 = 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([stride for stride in self.view.strides[:self.view.ndim]])
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__305, 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([stride for stride in self.view.strides[: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_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
    __pyx_t_3 = __pyx_t_5;
    __pyx_v_stride = (__pyx_t_3[0]);
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 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_6);
  __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_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_v_suboffset;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t *__pyx_t_4;
  Py_ssize_t *__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);

  /* "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([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_int(__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);
    __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__306, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 529; __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":531
 *                 return (-1,) * self.view.ndim
 * 
 *             return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])             # <<<<<<<<<<<<<<
 * 
 *     property ndim:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
    __pyx_t_4 = __pyx_t_6;
    __pyx_v_suboffset = (__pyx_t_4[0]);
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); 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);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 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_3);
  __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_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_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_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_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_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_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_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_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;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  Py_ssize_t *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  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.view.shape[:self.view.ndim]:
 */
    __Pyx_INCREF(__pyx_int_1);
    __pyx_v_result = __pyx_int_1;

    /* "View.MemoryView":554
 *                 result = 1
 * 
 *                 for length in self.view.shape[:self.view.ndim]:             # <<<<<<<<<<<<<<
 *                     result *= length
 * 
 */
    __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
    for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "View.MemoryView":555
 * 
 *                 for length in self.view.shape[:self.view.ndim]:
 *                     result *= length             # <<<<<<<<<<<<<<
 * 
 *                 self._size = result
 */
      __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
      __pyx_t_6 = 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_6);
  __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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  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 (likely(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; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(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_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_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_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); 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);
        { Py_ssize_t __pyx_temp;
          for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
            __Pyx_INCREF(__pyx_slice__307);
            PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__307);
            __Pyx_GIVEREF(__pyx_slice__307);
          }
        }
        __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_PyList_Append(__pyx_v_result, __pyx_slice__308); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __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_2 = PySlice_Check(__pyx_v_item); 
      __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
      if (__pyx_t_10) {
      } else {
        __pyx_t_1 = __pyx_t_10;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
      __pyx_t_1 = __pyx_t_10;
      __pyx_L9_bool_binop_done:;
      if (__pyx_t_1) {

        /* "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_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); 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);
        __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); 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);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_Raise(__pyx_t_7, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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)
 * 
 */
      __pyx_t_10 = (__pyx_v_have_slices != 0);
      if (!__pyx_t_10) {
      } else {
        __pyx_t_1 = __pyx_t_10;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_10 = PySlice_Check(__pyx_v_item); 
      __pyx_t_2 = (__pyx_t_10 != 0);
      __pyx_t_1 = __pyx_t_2;
      __pyx_L11_bool_binop_done:;
      __pyx_v_have_slices = __pyx_t_1;

      /* "View.MemoryView":648
 * 
 *             have_slices = have_slices or isinstance(item, slice)
 *             result.append(item)             # <<<<<<<<<<<<<<
 * 
 *     nslices = ndim - len(result)
 */
      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L6:;

    /* "View.MemoryView":635
 *     have_slices = False
 *     seen_ellipsis = False
 *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 */
  }
  __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_1 = (__pyx_v_nslices != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":652
 *     nslices = ndim - len(result)
 *     if nslices:
 *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
 * 
 *     return have_slices or nslices, tuple(result)
 */
    __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); 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);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
        __Pyx_INCREF(__pyx_slice__309);
        PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__309);
        __Pyx_GIVEREF(__pyx_slice__309);
      }
    }
    __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "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);
  if (!__pyx_v_have_slices) {
  } else {
    __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_3 = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); 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 = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_L14_bool_binop_done:;
  __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_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __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);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_r = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 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_11);
  __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):             # <<<<<<<<<<<<<<
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
 */

static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
  Py_ssize_t __pyx_v_suboffset;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t *__pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);

  /* "View.MemoryView":657
 * 
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
 *     for suboffset in suboffsets[:ndim]:             # <<<<<<<<<<<<<<
 *         if suboffset >= 0:
 *             raise ValueError("Indirect dimensions not supported")
 */
  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
    __pyx_t_1 = __pyx_t_3;
    __pyx_v_suboffset = (__pyx_t_1[0]);

    /* "View.MemoryView":658
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Indirect dimensions not supported")
 * 
 */
    __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
    if (__pyx_t_4) {

      /* "View.MemoryView":659
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
 *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__310, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 659; __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[7]; __pyx_lineno = 659; __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):             # <<<<<<<<<<<<<<
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __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":666
 * 
 * @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;
  Py_ssize_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memview_slice", 0);

  /* "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
 *     cdef __Pyx_memviewslice src, dst
 */
  __pyx_v_new_ndim = 0;
  __pyx_v_suboffset_dim = -1;

  /* "View.MemoryView":674
 * 
 * 
 *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
 * 
 *     cdef _memoryviewslice memviewsliceobj
 */
  memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));

  /* "View.MemoryView":678
 *     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 = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "View.MemoryView":680
 *     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":681
 * 
 *     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 = 681; __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":682
 *     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":684
 *         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":685
 *     else:
 *         slice_copy(memview, &src)
 *         p_src = &src             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_p_src = (&__pyx_v_src);
  }
  __pyx_L3:;

  /* "View.MemoryView":691
 * 
 * 
 *     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":692
 * 
 *     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":697
 * 
 * 
 *     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":698
 * 
 *     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":702
 *     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 (likely(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 = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(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 = 702; __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 = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        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 = 702; __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 = 702; __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 = 702; __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":703
 * 
 *     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 = (PyIndex_Check(__pyx_v_index) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":707
 *                 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 = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "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],
 *                 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 = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }

    /* "View.MemoryView":710
 *                 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":711
 *                 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":712
 *         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":713
 *             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":714
 *             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":716
 *             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 = 716; __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 = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else {
        __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_10 = __pyx_t_12;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_10 = 0;
      __pyx_L7_bool_binop_done:;
      __pyx_v_start = __pyx_t_10;

      /* "View.MemoryView":717
 *         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_stop); 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;
      } else {
        __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_10 = __pyx_t_12;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_10 = 0;
      __pyx_L9_bool_binop_done:;
      __pyx_v_stop = __pyx_t_10;

      /* "View.MemoryView":718
 *             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 = 718; __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 = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else {
        __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_10 = __pyx_t_12;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_10 = 0;
      __pyx_L11_bool_binop_done:;
      __pyx_v_step = __pyx_t_10;

      /* "View.MemoryView":720
 *             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_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = (__pyx_t_9 != Py_None);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_have_start = __pyx_t_1;

      /* "View.MemoryView":721
 * 
 *             have_start = index.start is not None
 *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
 *             have_step = index.step is not None
 * 
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = (__pyx_t_9 != Py_None);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_have_stop = __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             # <<<<<<<<<<<<<<
 * 
 *             slice_memviewslice(
 */
      __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 = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = (__pyx_t_9 != Py_None);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_have_step = __pyx_t_1;

      /* "View.MemoryView":724
 *             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 = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "View.MemoryView":730
 *                 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:;

    /* "View.MemoryView":702
 *     cdef bint have_start, have_stop, have_step
 * 
 *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
 *         if PyIndex_Check(index):
 *             slice_memviewslice(
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "View.MemoryView":732
 *             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":733
 * 
 *     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":734
 *     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 = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }

    /* "View.MemoryView":735
 *         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 = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }

    /* "View.MemoryView":733
 * 
 *     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 = 733; __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 = 733; __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":738
 *                                     memview.dtype_is_object)
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));

    /* "View.MemoryView":739
 *     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 = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);

    /* "View.MemoryView":738
 *                                     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 = 738; __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":666
 * 
 * @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_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":763
 * 
 * @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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":783
 *     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":785
 *     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":786
 * 
 *         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":787
 *         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":788
 *             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 = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":791
 *     else:
 * 
 *         negative_step = have_step != 0 and step < 0             # <<<<<<<<<<<<<<
 * 
 *         if have_step and step == 0:
 */
    __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
    if (__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_1 = ((__pyx_v_step < 0) != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L6_bool_binop_done:;
    __pyx_v_negative_step = __pyx_t_2;

    /* "View.MemoryView":793
 *         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)
 * 
 */
    __pyx_t_1 = (__pyx_v_have_step != 0);
    if (__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_1 = ((__pyx_v_step == 0) != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_2) {

      /* "View.MemoryView":794
 * 
 *         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 = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "View.MemoryView":797
 * 
 * 
 *         if have_start:             # <<<<<<<<<<<<<<
 *             if start < 0:
 *                 start += shape
 */
    __pyx_t_2 = (__pyx_v_have_start != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":798
 * 
 *         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":799
 *         if have_start:
 *             if start < 0:
 *                 start += shape             # <<<<<<<<<<<<<<
 *                 if start < 0:
 *                     start = 0
 */
        __pyx_v_start = (__pyx_v_start + __pyx_v_shape);

        /* "View.MemoryView":800
 *             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":801
 *                 start += shape
 *                 if start < 0:
 *                     start = 0             # <<<<<<<<<<<<<<
 *             elif start >= shape:
 *                 if negative_step:
 */
          __pyx_v_start = 0;
          goto __pyx_L13;
        }
        __pyx_L13:;
        goto __pyx_L12;
      }

      /* "View.MemoryView":802
 *                 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":803
 *                     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":804
 *             elif start >= shape:
 *                 if negative_step:
 *                     start = shape - 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     start = shape
 */
          __pyx_v_start = (__pyx_v_shape - 1);
          goto __pyx_L14;
        }
        /*else*/ {

          /* "View.MemoryView":806
 *                     start = shape - 1
 *                 else:
 *                     start = shape             # <<<<<<<<<<<<<<
 *         else:
 *             if negative_step:
 */
          __pyx_v_start = __pyx_v_shape;
        }
        __pyx_L14:;
        goto __pyx_L12;
      }
      __pyx_L12:;
      goto __pyx_L11;
    }
    /*else*/ {

      /* "View.MemoryView":808
 *                     start = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 start = shape - 1
 *             else:
 */
      __pyx_t_2 = (__pyx_v_negative_step != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":809
 *         else:
 *             if negative_step:
 *                 start = shape - 1             # <<<<<<<<<<<<<<
 *             else:
 *                 start = 0
 */
        __pyx_v_start = (__pyx_v_shape - 1);
        goto __pyx_L15;
      }
      /*else*/ {

        /* "View.MemoryView":811
 *                 start = shape - 1
 *             else:
 *                 start = 0             # <<<<<<<<<<<<<<
 * 
 *         if have_stop:
 */
        __pyx_v_start = 0;
      }
      __pyx_L15:;
    }
    __pyx_L11:;

    /* "View.MemoryView":813
 *                 start = 0
 * 
 *         if have_stop:             # <<<<<<<<<<<<<<
 *             if stop < 0:
 *                 stop += shape
 */
    __pyx_t_2 = (__pyx_v_have_stop != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":814
 * 
 *         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":815
 *         if have_stop:
 *             if stop < 0:
 *                 stop += shape             # <<<<<<<<<<<<<<
 *                 if stop < 0:
 *                     stop = 0
 */
        __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);

        /* "View.MemoryView":816
 *             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":817
 *                 stop += shape
 *                 if stop < 0:
 *                     stop = 0             # <<<<<<<<<<<<<<
 *             elif stop > shape:
 *                 stop = shape
 */
          __pyx_v_stop = 0;
          goto __pyx_L18;
        }
        __pyx_L18:;
        goto __pyx_L17;
      }

      /* "View.MemoryView":818
 *                 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":819
 *                     stop = 0
 *             elif stop > shape:
 *                 stop = shape             # <<<<<<<<<<<<<<
 *         else:
 *             if negative_step:
 */
        __pyx_v_stop = __pyx_v_shape;
        goto __pyx_L17;
      }
      __pyx_L17:;
      goto __pyx_L16;
    }
    /*else*/ {

      /* "View.MemoryView":821
 *                 stop = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 stop = -1
 *             else:
 */
      __pyx_t_2 = (__pyx_v_negative_step != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":822
 *         else:
 *             if negative_step:
 *                 stop = -1             # <<<<<<<<<<<<<<
 *             else:
 *                 stop = shape
 */
        __pyx_v_stop = -1;
        goto __pyx_L19;
      }
      /*else*/ {

        /* "View.MemoryView":824
 *                 stop = -1
 *             else:
 *                 stop = shape             # <<<<<<<<<<<<<<
 * 
 *         if not have_step:
 */
        __pyx_v_stop = __pyx_v_shape;
      }
      __pyx_L19:;
    }
    __pyx_L16:;

    /* "View.MemoryView":826
 *                 stop = shape
 * 
 *         if not have_step:             # <<<<<<<<<<<<<<
 *             step = 1
 * 
 */
    __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":827
 * 
 *         if not have_step:
 *             step = 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_step = 1;
      goto __pyx_L20;
    }
    __pyx_L20:;

    /* "View.MemoryView":831
 * 
 *         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":833
 *             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":834
 * 
 *             if (stop - start) - step * new_shape:
 *                 new_shape += 1             # <<<<<<<<<<<<<<
 * 
 *         if new_shape < 0:
 */
      __pyx_v_new_shape = (__pyx_v_new_shape + 1);
      goto __pyx_L21;
    }
    __pyx_L21:;

    /* "View.MemoryView":836
 *                 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":837
 * 
 *         if new_shape < 0:
 *             new_shape = 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_new_shape = 0;
      goto __pyx_L22;
    }
    __pyx_L22:;

    /* "View.MemoryView":840
 * 
 * 
 *         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":841
 * 
 *         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":842
 *         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":845
 * 
 * 
 *     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":846
 * 
 *     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_L23;
  }
  /*else*/ {

    /* "View.MemoryView":848
 *         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_L23:;

  /* "View.MemoryView":850
 *         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":851
 * 
 *     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":852
 *     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":853
 *         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_L26;
      }
      /*else*/ {

        /* "View.MemoryView":855
 *                 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 = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L26:;
      goto __pyx_L25;
    }
    /*else*/ {

      /* "View.MemoryView":858
 *                                      "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_L25:;
    goto __pyx_L24;
  }
  __pyx_L24:;

  /* "View.MemoryView":860
 *             suboffset_dim[0] = new_ndim
 * 
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":763
 * 
 * @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":866
 * 
 * @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":868
 * 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":869
 *                           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":872
 *     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":873
 * 
 *     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 = 873; __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 = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);

    /* "View.MemoryView":874
 *     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":876
 *         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":877
 *     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":878
 *         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":879
 *         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":881
 *             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":882
 * 
 *     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":883
 *     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":884
 *         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 = 884; __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 = 884; __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 = 884; __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 = 884; __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 = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "View.MemoryView":886
 *             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":887
 * 
 *     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 = 887; __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 = 887; __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 = 887; __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 = 887; __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 = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "View.MemoryView":889
 *         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":890
 * 
 *     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":891
 *     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":893
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
 *     return resultp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_resultp;
  goto __pyx_L0;

  /* "View.MemoryView":866
 * 
 * @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":899
 * 
 * @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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":900
 * @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":902
 *     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":903
 * 
 *     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":907
 * 
 *     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":908
 *     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":909
 *     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":910
 *         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":912
 *         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_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_6) {

      /* "View.MemoryView":913
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
 *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
 * 
 *     return 1
 */
      __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, __pyx_k_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
  }

  /* "View.MemoryView":915
 *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
 *     return 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "View.MemoryView":899
 * 
 * @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":932
 *     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___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));

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

static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "View.MemoryView":933
 * 
 *     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":932
 *     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":935
 *         __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":936
 * 
 *     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":937
 *     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 = 937; __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":939
 *             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_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 = 939; __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":935
 *         __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":941
 *             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":942
 * 
 *     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":943
 *     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 = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":945
 *             self.to_dtype_func(itemp, value)
 *         else:
 *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
 * 
 *     property base:
 */
    __pyx_t_3 = __pyx_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 = 945; __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":941
 *             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":949
 *     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_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":950
 *         @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":949
 *     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":956
 * 
 * @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;
  Py_ssize_t __pyx_v_suboffset;
  PyObject *__pyx_v_length = NULL;
  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;
  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("memoryview_fromslice", 0);

  /* "View.MemoryView":964
 *     cdef _memoryviewslice result
 * 
 *     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":965
 * 
 *     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":970
 * 
 * 
 *     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 = 970; __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 = 970; __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 = 970; __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":972
 *     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":973
 * 
 *     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":975
 *     __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 = 975; __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":976
 * 
 *     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":978
 *     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":979
 * 
 *     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":980
 *     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":981
 *     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":982
 *     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":984
 *     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":986
 *     result.flags = PyBUF_RECORDS
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
 * 
 */
  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);

  /* "View.MemoryView":987
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);

  /* "View.MemoryView":990
 * 
 * 
 *     result.view.suboffsets = NULL             # <<<<<<<<<<<<<<
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:
 */
  __pyx_v_result->__pyx_base.view.suboffsets = NULL;

  /* "View.MemoryView":991
 * 
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:             # <<<<<<<<<<<<<<
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 */
  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
    __pyx_t_6 = __pyx_t_8;
    __pyx_v_suboffset = (__pyx_t_6[0]);

    /* "View.MemoryView":992
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break
 */
    __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":993
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
 *             break
 * 
 */
      __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);

      /* "View.MemoryView":994
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break             # <<<<<<<<<<<<<<
 * 
 *     result.view.len = result.view.itemsize
 */
      goto __pyx_L5_break;
    }
  }
  __pyx_L5_break:;

  /* "View.MemoryView":996
 *             break
 * 
 *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
 *     for length in result.view.shape[:ndim]:
 *         result.view.len *= length
 */
  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;

  /* "View.MemoryView":997
 * 
 *     result.view.len = result.view.itemsize
 *     for length in result.view.shape[:ndim]:             # <<<<<<<<<<<<<<
 *         result.view.len *= length
 * 
 */
  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
    __pyx_t_6 = __pyx_t_8;
    __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "View.MemoryView":998
 *     result.view.len = result.view.itemsize
 *     for length in result.view.shape[:ndim]:
 *         result.view.len *= length             # <<<<<<<<<<<<<<
 * 
 *     result.to_object_func = to_object_func
 */
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
  }

  /* "View.MemoryView":1000
 *         result.view.len *= length
 * 
 *     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":1001
 * 
 *     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":1003
 *     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":956
 * 
 * @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_XDECREF(__pyx_v_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1006
 * 
 * @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":1009
 *                                                    __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":1010
 *     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 = 1010; __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":1011
 *     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":1013
 *         return &obj.from_slice
 *     else:
 *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
 *         return mslice
 * 
 */
    __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);

    /* "View.MemoryView":1014
 *     else:
 *         slice_copy(memview, mslice)
 *         return mslice             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_slice_copy')
 */
    __pyx_r = __pyx_v_mslice;
    goto __pyx_L0;
  }

  /* "View.MemoryView":1006
 * 
 * @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":1017
 * 
 * @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;
  Py_ssize_t __pyx_t_4;
  __Pyx_RefNannySetupContext("slice_copy", 0);

  /* "View.MemoryView":1021
 *     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":1022
 * 
 *     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":1023
 *     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":1025
 *     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":1026
 * 
 *     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":1028
 *     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":1029
 * 
 *     for dim in range(memview.view.ndim):
 *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
 *         dst.strides[dim] = strides[dim]
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
 */
    (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);

    /* "View.MemoryView":1030
 *     for dim in range(memview.view.ndim):
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
 * 
 */
    (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);

    /* "View.MemoryView":1031
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_object')
 */
    if ((__pyx_v_suboffsets != 0)) {
      __pyx_t_4 = (__pyx_v_suboffsets[__pyx_v_dim]);
    } else {
      __pyx_t_4 = -1;
    }
    (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4;
  }

  /* "View.MemoryView":1017
 * 
 * @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":1034
 * 
 * @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":1037
 *     "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":1038
 *     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 = 1038; __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":1034
 * 
 * @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":1041
 * 
 * @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":1048
 *     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":1049
 * 
 *     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":1050
 *     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":1052
 *         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":1053
 *     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":1055
 *         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":1057
 *     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 = 1055; __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":1041
 * 
 * @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":1063
 * 
 * 
 * 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":1064
 * 
 * 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":1065
 * 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":1067
 *         return -arg
 *     else:
 *         return arg             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_get_best_slice_order')
 */
    __pyx_r = __pyx_v_arg;
    goto __pyx_L0;
  }

  /* "View.MemoryView":1063
 * 
 * 
 * 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":1070
 * 
 * @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":1075
 *     """
 *     cdef int i
 *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t f_stride = 0
 * 
 */
  __pyx_v_c_stride = 0;

  /* "View.MemoryView":1076
 *     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":1078
 *     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":1079
 * 
 *     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":1080
 *     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":1081
 *         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":1083
 *             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":1084
 * 
 *     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":1085
 *     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":1086
 *         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":1088
 *             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":1089
 * 
 *     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":1091
 *         return 'C'
 *     else:
 *         return 'F'             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
 */
    __pyx_r = 'F';
    goto __pyx_L0;
  }

  /* "View.MemoryView":1070
 * 
 * @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":1094
 * 
 * @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;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;

  /* "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]
 */
  __pyx_v_src_extent = (__pyx_v_src_shape[0]);

  /* "View.MemoryView":1102
 *     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":1103
 *     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":1104
 *     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":1106
 *     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":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)
 */
    __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }

    /* "View.MemoryView":1108
 *     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_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
    if (__pyx_t_2) {
      __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
    }
    __pyx_t_3 = (__pyx_t_2 != 0);
    __pyx_t_1 = __pyx_t_3;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_1) {

      /* "View.MemoryView":1109
 *        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":1111
 *            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_4 = __pyx_v_dst_extent;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;

        /* "View.MemoryView":1112
 *        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":1113
 *            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":1114
 *                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":1116
 *                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_4 = __pyx_v_dst_extent;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "View.MemoryView":1117
 *     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":1121
 *                                      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":1122
 *                                      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":1094
 * 
 * @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":1124
 *             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":1127
 *                                   __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":1124
 *             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":1131
 * 
 * @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":1134
 *     "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":1136
 *     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":1137
 * 
 *     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":1139
 *         size *= src.shape[i]
 * 
 *     return size             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_fill_contig_strides_array')
 */
  __pyx_r = __pyx_v_size;
  goto __pyx_L0;

  /* "View.MemoryView":1131
 * 
 * @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":1142
 * 
 * @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":1151
 *     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":1152
 * 
 *     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":1153
 *     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":1154
 *         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":1156
 *             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":1157
 *     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":1158
 *         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":1160
 *             stride = stride * shape[idx]
 * 
 *     return stride             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
 */
  __pyx_r = __pyx_v_stride;
  goto __pyx_L0;

  /* "View.MemoryView":1142
 * 
 * @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":1163
 * 
 * @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":1174
 *     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":1175
 * 
 *     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":1177
 *     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":1178
 * 
 *     result = malloc(size)
 *     if not result:             # <<<<<<<<<<<<<<
 *         _err(MemoryError, NULL)
 * 
 */
  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1179
 *     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 = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":1182
 * 
 * 
 *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):
 */
  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);

  /* "View.MemoryView":1183
 * 
 *     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":1184
 *     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":1185
 *     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":1186
 *     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":1188
 *         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":1192
 * 
 * 
 *     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":1193
 * 
 *     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":1194
 *     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":1196
 *             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":1197
 * 
 *     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":1199
 *         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":1201
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "View.MemoryView":1163
 * 
 * @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":1206
 * 
 * @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":1209
 *                              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 = 1209; __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 = 1209; __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 = 1209; __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 = 1209; __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":1208
 * 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 = 1208; __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 = 1208; __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 = 1208; __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 = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "View.MemoryView":1206
 * 
 * @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":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)
 * 
 */

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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = 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":1213
 * @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_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 = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1213; __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_INCREF(__pyx_v_error);
  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1213; __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 = NULL;
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1213; __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_3); __pyx_t_3 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_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)
 * 
 */

  /* 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);
  __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":1216
 * 
 * @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;
  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;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_err", 0);
  __Pyx_INCREF(__pyx_v_error);

  /* "View.MemoryView":1217
 * @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":1218
 * cdef int _err(object error, char *msg) except -1 with gil:
 *     if msg != NULL:
 *         raise error(msg.decode('ascii'))             # <<<<<<<<<<<<<<
 *     else:
 *         raise error
 */
    __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_error);
    __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1218; __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); __pyx_t_5 = NULL;
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1218; __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_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  /*else*/ {

    /* "View.MemoryView":1220
 *         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 = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_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'))
 */

  /* 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);
  __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":1223
 * 
 * @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":1231
 *     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":1232
 *     """
 *     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":1234
 *     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":1235
 *     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":1236
 *     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":1239
 *     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":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_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
    goto __pyx_L3;
  }

  /* "View.MemoryView":1241
 *     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":1242
 *         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":1244
 *         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":1246
 *     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":1247
 * 
 *     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":1248
 *     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":1249
 *         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":1250
 *             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":1252
 *                 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 = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L7:;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "View.MemoryView":1254
 *                 _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":1255
 * 
 *         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 = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  /* "View.MemoryView":1257
 *             _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":1259
 *     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":1260
 * 
 *         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":1262
 *             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 = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_tmpdata = __pyx_t_6;

    /* "View.MemoryView":1263
 * 
 *         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":1265
 *         src = tmp
 * 
 *     if not broadcasting:             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 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):
 */
    __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'C', __pyx_v_ndim) != 0);
    if (__pyx_t_2) {

      /* "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_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'C', __pyx_v_ndim);
      goto __pyx_L12;
    }

    /* "View.MemoryView":1270
 *         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":1271
 *             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":1273
 *             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":1275
 *         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":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)
 */
      memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));

      /* "View.MemoryView":1277
 *             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":1278
 *             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":1279
 *             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":1281
 *             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":1284
 * 
 * 
 *         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 = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "View.MemoryView":1285
 * 
 *         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 = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L14;
  }
  __pyx_L14:;

  /* "View.MemoryView":1287
 *         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":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)
 * 
 */
  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);

  /* "View.MemoryView":1289
 *     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":1291
 *     refcount_copying(&dst, dtype_is_object, ndim, True)
 * 
 *     free(tmpdata)             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  free(__pyx_v_tmpdata);

  /* "View.MemoryView":1292
 * 
 *     free(tmpdata)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1223
 * 
 * @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":1295
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
 *                             int ndim,
 *                             int ndim_other) nogil:
 */

static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, 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":1299
 *                             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":1301
 *     cdef int offset = ndim_other - ndim
 * 
 *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = 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":1302
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         mslice.shape[i + offset] = mslice.shape[i]             # <<<<<<<<<<<<<<
 *         mslice.strides[i + offset] = mslice.strides[i]
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
 */
    (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);

    /* "View.MemoryView":1303
 *     for i in range(ndim - 1, -1, -1):
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = mslice.strides[i]             # <<<<<<<<<<<<<<
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
 * 
 */
    (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);

    /* "View.MemoryView":1304
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = mslice.strides[i]
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]             # <<<<<<<<<<<<<<
 * 
 *     for i in range(offset):
 */
    (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
  }

  /* "View.MemoryView":1306
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
 * 
 *     for i in range(offset):             # <<<<<<<<<<<<<<
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.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":1307
 * 
 *     for i in range(offset):
 *         mslice.shape[i] = 1             # <<<<<<<<<<<<<<
 *         mslice.strides[i] = mslice.strides[0]
 *         mslice.suboffsets[i] = -1
 */
    (__pyx_v_mslice->shape[__pyx_v_i]) = 1;

    /* "View.MemoryView":1308
 *     for i in range(offset):
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]             # <<<<<<<<<<<<<<
 *         mslice.suboffsets[i] = -1
 * 
 */
    (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);

    /* "View.MemoryView":1309
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]
 *         mslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1;
  }

  /* "View.MemoryView":1295
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
 *                             int ndim,
 *                             int ndim_other) nogil:
 */

  /* function exit code */
}

/* "View.MemoryView":1317
 * 
 * @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":1321
 * 
 * 
 *     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":1322
 * 
 *     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":1317
 * 
 * @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":1326
 * 
 * @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":1329
 *                                              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":1326
 * 
 * @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":1332
 * 
 * @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":1336
 *     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":1337
 * 
 *     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":1338
 *     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":1339
 *         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":1341
 *                 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":1343
 *                 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":1346
 *                                       ndim - 1, inc)
 * 
 *         data += strides[0]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
  }

  /* "View.MemoryView":1332
 * 
 * @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":1352
 * 
 * @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":1355
 *                               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":1356
 *                               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":1358
 *     _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":1352
 * 
 * @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":1362
 * 
 * @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":1366
 *                               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":1367
 *     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":1369
 *     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":1370
 * 
 *     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":1371
 *     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":1372
 *         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":1374
 *             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":1375
 *     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":1377
 *             _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":1362
 * 
 * @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)
  "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*/
  0, /*tp_version_tag*/
  #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[] = {
  {"get", (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_7get, METH_O, 0},
  {"insert", (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_9insert, METH_O, 0},
  {"remove", (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_11remove, METH_O, 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)
  "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*/
  "\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*/
  0, /*tp_version_tag*/
  #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[] = {
  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 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
  __pyx_array_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type___pyx_array = {
  PyVarObject_HEAD_INIT(0, 0)
  "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*/
  0, /*tp_version_tag*/
  #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)
  "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*/
  0, /*tp_version_tag*/
  #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[] = {
  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 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
  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type___pyx_memoryview = {
  PyVarObject_HEAD_INIT(0, 0)
  "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*/
  0, /*tp_version_tag*/
  #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)
  "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*/
  "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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {"ensure_platform_int", (PyCFunction)__pyx_pw_6pandas_5algos_89ensure_platform_int, METH_O, 0},
  {"ensure_object", (PyCFunction)__pyx_pw_6pandas_5algos_91ensure_object, METH_O, 0},
  {"ensure_float64", (PyCFunction)__pyx_pw_6pandas_5algos_93ensure_float64, METH_O, 0},
  {"ensure_float32", (PyCFunction)__pyx_pw_6pandas_5algos_95ensure_float32, METH_O, 0},
  {"ensure_int8", (PyCFunction)__pyx_pw_6pandas_5algos_97ensure_int8, METH_O, 0},
  {"ensure_int16", (PyCFunction)__pyx_pw_6pandas_5algos_99ensure_int16, METH_O, 0},
  {"ensure_int32", (PyCFunction)__pyx_pw_6pandas_5algos_101ensure_int32, METH_O, 0},
  {"ensure_int64", (PyCFunction)__pyx_pw_6pandas_5algos_103ensure_int64, METH_O, 0},
  {"map_indices_float64", (PyCFunction)__pyx_pw_6pandas_5algos_105map_indices_float64, METH_O, __pyx_doc_6pandas_5algos_104map_indices_float64},
  {"map_indices_float32", (PyCFunction)__pyx_pw_6pandas_5algos_107map_indices_float32, METH_O, __pyx_doc_6pandas_5algos_106map_indices_float32},
  {"map_indices_object", (PyCFunction)__pyx_pw_6pandas_5algos_109map_indices_object, METH_O, __pyx_doc_6pandas_5algos_108map_indices_object},
  {"map_indices_int32", (PyCFunction)__pyx_pw_6pandas_5algos_111map_indices_int32, METH_O, __pyx_doc_6pandas_5algos_110map_indices_int32},
  {"map_indices_int64", (PyCFunction)__pyx_pw_6pandas_5algos_113map_indices_int64, METH_O, __pyx_doc_6pandas_5algos_112map_indices_int64},
  {"map_indices_bool", (PyCFunction)__pyx_pw_6pandas_5algos_115map_indices_bool, METH_O, __pyx_doc_6pandas_5algos_114map_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
    "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_kp_s_Argument_values_must_have_only_o, __pyx_k_Argument_values_must_have_only_o, sizeof(__pyx_k_Argument_values_must_have_only_o), 0, 0, 1, 0},
  {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
  {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
  {&__pyx_n_s_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_kp_s_Users_jreback_pandas_pandas_alg, __pyx_k_Users_jreback_pandas_pandas_alg, sizeof(__pyx_k_Users_jreback_pandas_pandas_alg), 0, 0, 1, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_kp_s__31, __pyx_k__31, sizeof(__pyx_k__31), 0, 0, 1, 0},
  {&__pyx_kp_s__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 1, 0},
  {&__pyx_n_s__389, __pyx_k__389, sizeof(__pyx_k__389), 0, 0, 1, 1},
  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
  {&__pyx_n_s_adjust, __pyx_k_adjust, sizeof(__pyx_k_adjust), 0, 0, 1, 1},
  {&__pyx_n_s_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_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 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_kp_s_arrays_are_of_different_lengths, __pyx_k_arrays_are_of_different_lengths, sizeof(__pyx_k_arrays_are_of_different_lengths), 0, 0, 1, 0},
  {&__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_asobject, __pyx_k_asobject, sizeof(__pyx_k_asobject), 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_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_bias, __pyx_k_bias, sizeof(__pyx_k_bias), 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_n_s_concatenate, __pyx_k_concatenate, sizeof(__pyx_k_concatenate), 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_cur_x, __pyx_k_cur_x, sizeof(__pyx_k_cur_x), 0, 0, 1, 1},
  {&__pyx_n_s_cur_y, __pyx_k_cur_y, sizeof(__pyx_k_cur_y), 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_denominator, __pyx_k_denominator, sizeof(__pyx_k_denominator), 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_ewmcov, __pyx_k_ewmcov, sizeof(__pyx_k_ewmcov), 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_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_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 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_int64, __pyx_k_group_last_bin_int64, sizeof(__pyx_k_group_last_bin_int64), 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_int64, __pyx_k_group_last_int64, sizeof(__pyx_k_group_last_int64), 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_bin_int64, __pyx_k_group_max_bin_int64, sizeof(__pyx_k_group_max_bin_int64), 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_max_int64, __pyx_k_group_max_int64, sizeof(__pyx_k_group_max_int64), 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_bin_int64, __pyx_k_group_min_bin_int64, sizeof(__pyx_k_group_min_bin_int64), 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_min_int64, __pyx_k_group_min_int64, sizeof(__pyx_k_group_min_int64), 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_int64, __pyx_k_group_nth_bin_int64, sizeof(__pyx_k_group_nth_bin_int64), 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_int64, __pyx_k_group_nth_int64, sizeof(__pyx_k_group_nth_int64), 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_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_ignore_na, __pyx_k_ignore_na, sizeof(__pyx_k_ignore_na), 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_input_x, __pyx_k_input_x, sizeof(__pyx_k_input_x), 0, 0, 1, 1},
  {&__pyx_n_s_input_y, __pyx_k_input_y, sizeof(__pyx_k_input_y), 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_dec, __pyx_k_is_monotonic_dec, sizeof(__pyx_k_is_monotonic_dec), 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_inc, __pyx_k_is_monotonic_inc, sizeof(__pyx_k_is_monotonic_inc), 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_observation, __pyx_k_is_observation, sizeof(__pyx_k_is_observation), 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_mean_y, __pyx_k_mean_y, sizeof(__pyx_k_mean_y), 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_new_wt, __pyx_k_new_wt, sizeof(__pyx_k_new_wt), 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_numerator, __pyx_k_numerator, sizeof(__pyx_k_numerator), 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_old_mean_x, __pyx_k_old_mean_x, sizeof(__pyx_k_old_mean_x), 0, 0, 1, 1},
  {&__pyx_n_s_old_mean_y, __pyx_k_old_mean_y, sizeof(__pyx_k_old_mean_y), 0, 0, 1, 1},
  {&__pyx_n_s_old_wt, __pyx_k_old_wt, sizeof(__pyx_k_old_wt), 0, 0, 1, 1},
  {&__pyx_n_s_old_wt_factor, __pyx_k_old_wt_factor, sizeof(__pyx_k_old_wt_factor), 0, 0, 1, 1},
  {&__pyx_n_s_oldbuf, __pyx_k_oldbuf, sizeof(__pyx_k_oldbuf), 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_period, __pyx_k_period, sizeof(__pyx_k_period), 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_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_wt, __pyx_k_sum_wt, sizeof(__pyx_k_sum_wt), 0, 0, 1, 1},
  {&__pyx_n_s_sum_wt2, __pyx_k_sum_wt2, sizeof(__pyx_k_sum_wt2), 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_timelike, __pyx_k_timelike, sizeof(__pyx_k_timelike), 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_typ, __pyx_k_typ, sizeof(__pyx_k_typ), 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_weighted_avg, __pyx_k_weighted_avg, sizeof(__pyx_k_weighted_avg), 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_writeable, __pyx_k_writeable, sizeof(__pyx_k_writeable), 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_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 = 555; __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 = 499; __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 = 535; __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 = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __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 = 755; __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 = 755; __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 = 2096; __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 = 7537; __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 = 41; __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;}
  __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":179
 * 
 *     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 = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__2);
  __Pyx_GIVEREF(__pyx_slice__2);

  /* "pandas/algos.pyx":182
 * 
 *     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 = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "pandas/algos.pyx":251
 * 
 *     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 = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__4);
  __Pyx_GIVEREF(__pyx_slice__4);

  /* "pandas/algos.pyx":254
 * 
 *     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 = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "pandas/algos.pyx":331
 *             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 = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "pandas/algos.pyx":334
 * 
 *     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 = 334; __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 = 334; __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 = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "pandas/algos.pyx":337
 * 
 *     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 = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "pandas/algos.pyx":373
 *                 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 = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__11);
  __Pyx_GIVEREF(__pyx_slice__11);

  /* "pandas/algos.pyx":411
 *             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 = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "pandas/algos.pyx":414
 * 
 *     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 = 414; __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 = 414; __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 = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "pandas/algos.pyx":417
 * 
 *     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 = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "pandas/algos.pyx":450
 *                 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 = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__17);
  __Pyx_GIVEREF(__pyx_slice__17);

  /* "pandas/algos.pyx":482
 * 
 *     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 = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "pandas/algos.pyx":511
 * 
 *     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 = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__19);
  __Pyx_GIVEREF(__pyx_slice__19);

  /* "pandas/algos.pyx":514
 * 
 *     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 = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "pandas/algos.pyx":535
 *                     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 = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "pandas/algos.pyx":605
 * 
 *     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 = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "pandas/algos.pyx":620
 * 
 *     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 = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "pandas/algos.pyx":634
 * 
 *     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 = 634; __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 = 634; __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 = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "pandas/algos.pyx":637
 * 
 *     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 = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "pandas/algos.pyx":663
 *                         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 = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "pandas/algos.pyx":671
 *                 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 = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__29);
  __Pyx_GIVEREF(__pyx_slice__29);

  /* "pandas/algos.pyx":709
 *         minp = N + 1
 *     elif minp < 0:
 *         raise ValueError('min_periods must be >= 0')             # <<<<<<<<<<<<<<
 *     return max(minp, floor)
 * 
 */
  __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 = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "pandas/algos.pyx":755
 * @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__32 = PyTuple_Pack(1, __pyx_kp_s__31); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s__33); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __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_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "pandas/algos.pyx":808
 * 
 * 
 * cpdef numeric median(numeric[:] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s__31); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s__33); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __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_No_matching_signature_found); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __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_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "pandas/algos.pyx":836
 * 
 *     if len(arr) == 0:
 *         return (-1,-1,None)             # <<<<<<<<<<<<<<
 * 
 *     m = arr[0]
 */
  __pyx_tuple__41 = PyTuple_Pack(3, __pyx_int_neg_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "pandas/algos.pyx":1785
 * cdef double_t _get_min(object skiplist, int nobs, int minp):
 *     if nobs >= minp:
 *         return <IndexableSkiplist> skiplist.get(0)             # <<<<<<<<<<<<<<
 *     else:
 *         return NaN
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "pandas/algos.pyx":1845
 * 
 *     if not input.flags.c_contiguous:
 *         input = input.copy('C')             # <<<<<<<<<<<<<<
 * 
 *     n = len(input)
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "pandas/algos.pyx":2299
 * 
 *     indexer, _counts = groupsort_indexer(labels, ngroups)
 *     counts[:] = _counts[1:]             # <<<<<<<<<<<<<<
 * 
 *     data = np.empty((K, N), dtype=np.float64)
 */
  __pyx_slice__44 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__44);
  __Pyx_GIVEREF(__pyx_slice__44);
  __pyx_slice__45 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__45);
  __Pyx_GIVEREF(__pyx_slice__45);

  /* "pandas/src/join.pyx":201
 *         # length-0 case
 *         res = np.empty(len(indexer), dtype=np.int64)
 *         res.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     return res
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "pandas/src/join.pyx":237
 * 
 *     last_obs = np.empty(max_group, dtype=np.int64)
 *     last_obs.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "pandas/src/generated.pyx":272
 *     nright = len(new)
 *     indexer = np.empty(nright, dtype=np.int64)
 *     indexer.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     if limit is None:
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "pandas/src/generated.pyx":278
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "pandas/src/generated.pyx":333
 *     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 = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "pandas/src/generated.pyx":339
 *     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 = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "pandas/src/generated.pyx":394
 *     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 = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "pandas/src/generated.pyx":400
 *     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 = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "pandas/src/generated.pyx":455
 *     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 = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "pandas/src/generated.pyx":461
 *     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 = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "pandas/src/generated.pyx":516
 *     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 = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

  /* "pandas/src/generated.pyx":522
 *     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 = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "pandas/src/generated.pyx":577
 *     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 = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "pandas/src/generated.pyx":583
 *     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 = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "pandas/src/generated.pyx":639
 *     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 = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);

  /* "pandas/src/generated.pyx":645
 *     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 = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "pandas/src/generated.pyx":701
 *     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 = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "pandas/src/generated.pyx":707
 *     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 = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "pandas/src/generated.pyx":763
 *     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 = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "pandas/src/generated.pyx":769
 *     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 = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "pandas/src/generated.pyx":825
 *     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 = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "pandas/src/generated.pyx":831
 *     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 = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "pandas/src/generated.pyx":887
 *     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 = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "pandas/src/generated.pyx":893
 *     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 = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);

  /* "pandas/src/generated.pyx":949
 *     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 = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);

  /* "pandas/src/generated.pyx":955
 *     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 = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);

  /* "pandas/src/generated.pyx":1019
 *     else:
 *         if limit < 0:
 *             raise ValueError('Limit must be non-negative')             # <<<<<<<<<<<<<<
 *         lim = limit
 * 
 */
  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);

  /* "pandas/src/generated.pyx":1052
 *     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 = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "pandas/src/generated.pyx":1085
 *     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 = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);

  /* "pandas/src/generated.pyx":1118
 *     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 = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "pandas/src/generated.pyx":1151
 *     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 = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "pandas/src/generated.pyx":1184
 *     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 = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "pandas/src/generated.pyx":1218
 *     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 = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "pandas/src/generated.pyx":1250
 *     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 = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "pandas/src/generated.pyx":1282
 *     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 = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);

  /* "pandas/src/generated.pyx":1314
 *     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 = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);

  /* "pandas/src/generated.pyx":1346
 *     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 = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);

  /* "pandas/src/generated.pyx":1378
 *     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 = 1378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "pandas/src/generated.pyx":1411
 *     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 = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);

  /* "pandas/src/generated.pyx":1445
 *     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 = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);

  /* "pandas/src/generated.pyx":1479
 *     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 = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

  /* "pandas/src/generated.pyx":1513
 *     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 = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "pandas/src/generated.pyx":1547
 *     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 = 1547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);

  /* "pandas/src/generated.pyx":1581
 *     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 = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

  /* "pandas/src/generated.pyx":1616
 *     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 = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "pandas/src/generated.pyx":1650
 *     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 = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);

  /* "pandas/src/generated.pyx":1684
 *     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 = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

  /* "pandas/src/generated.pyx":1718
 *     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 = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);

  /* "pandas/src/generated.pyx":1752
 *     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 = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);

  /* "pandas/src/generated.pyx":1786
 *     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 = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);

  /* "pandas/src/generated.pyx":1822
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 *             return False, False, True             # <<<<<<<<<<<<<<
 *         else:
 *             return True, True, True
 */
  __pyx_tuple__96 = PyTuple_Pack(3, Py_False, Py_False, Py_True); if (unlikely(!__pyx_tuple__96)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);

  /* "pandas/src/generated.pyx":1824
 *             return False, False, True
 *         else:
 *             return True, True, True             # <<<<<<<<<<<<<<
 *     elif n < 2:
 *         return True, True, True
 */
  __pyx_tuple__97 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "pandas/src/generated.pyx":1826
 *             return True, True, True
 *     elif n < 2:
 *         return True, True, True             # <<<<<<<<<<<<<<
 * 
 *     if timelike and arr[0] == iNaT:
 */
  __pyx_tuple__98 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__98)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);

  /* "pandas/src/generated.pyx":1829
 * 
 *     if timelike and arr[0] == iNaT:
 *         return False, False, None             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
  __pyx_tuple__99 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__99)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);

  /* "pandas/src/generated.pyx":1835
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             is_monotonic_inc = 0
 */
  __pyx_tuple__100 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__100)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);

  /* "pandas/src/generated.pyx":1844
 *         else:
 *             # cur or prev is NaN
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 */
  __pyx_tuple__101 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__101)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);

  /* "pandas/src/generated.pyx":1846
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 */
  __pyx_tuple__102 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__102)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);

  /* "pandas/src/generated.pyx":1869
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 *             return False, False, True             # <<<<<<<<<<<<<<
 *         else:
 *             return True, True, True
 */
  __pyx_tuple__103 = PyTuple_Pack(3, Py_False, Py_False, Py_True); if (unlikely(!__pyx_tuple__103)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);

  /* "pandas/src/generated.pyx":1871
 *             return False, False, True
 *         else:
 *             return True, True, True             # <<<<<<<<<<<<<<
 *     elif n < 2:
 *         return True, True, True
 */
  __pyx_tuple__104 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__104)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);

  /* "pandas/src/generated.pyx":1873
 *             return True, True, True
 *     elif n < 2:
 *         return True, True, True             # <<<<<<<<<<<<<<
 * 
 *     if timelike and arr[0] == iNaT:
 */
  __pyx_tuple__105 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__105)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);

  /* "pandas/src/generated.pyx":1876
 * 
 *     if timelike and arr[0] == iNaT:
 *         return False, False, None             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
  __pyx_tuple__106 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__106)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);

  /* "pandas/src/generated.pyx":1882
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             is_monotonic_inc = 0
 */
  __pyx_tuple__107 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__107)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);

  /* "pandas/src/generated.pyx":1891
 *         else:
 *             # cur or prev is NaN
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 */
  __pyx_tuple__108 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__108)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);

  /* "pandas/src/generated.pyx":1893
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 */
  __pyx_tuple__109 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__109)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);

  /* "pandas/src/generated.pyx":1916
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 *             return False, False, True             # <<<<<<<<<<<<<<
 *         else:
 *             return True, True, True
 */
  __pyx_tuple__110 = PyTuple_Pack(3, Py_False, Py_False, Py_True); if (unlikely(!__pyx_tuple__110)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);

  /* "pandas/src/generated.pyx":1918
 *             return False, False, True
 *         else:
 *             return True, True, True             # <<<<<<<<<<<<<<
 *     elif n < 2:
 *         return True, True, True
 */
  __pyx_tuple__111 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__111)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);

  /* "pandas/src/generated.pyx":1920
 *             return True, True, True
 *     elif n < 2:
 *         return True, True, True             # <<<<<<<<<<<<<<
 * 
 *     if timelike and arr[0] == iNaT:
 */
  __pyx_tuple__112 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__112)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);

  /* "pandas/src/generated.pyx":1923
 * 
 *     if timelike and arr[0] == iNaT:
 *         return False, False, None             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
  __pyx_tuple__113 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__113)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "pandas/src/generated.pyx":1929
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             is_monotonic_inc = 0
 */
  __pyx_tuple__114 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__114)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);

  /* "pandas/src/generated.pyx":1938
 *         else:
 *             # cur or prev is NaN
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 */
  __pyx_tuple__115 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__115)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);

  /* "pandas/src/generated.pyx":1940
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 */
  __pyx_tuple__116 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__116)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);

  /* "pandas/src/generated.pyx":1963
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 *             return False, False, True             # <<<<<<<<<<<<<<
 *         else:
 *             return True, True, True
 */
  __pyx_tuple__117 = PyTuple_Pack(3, Py_False, Py_False, Py_True); if (unlikely(!__pyx_tuple__117)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);

  /* "pandas/src/generated.pyx":1965
 *             return False, False, True
 *         else:
 *             return True, True, True             # <<<<<<<<<<<<<<
 *     elif n < 2:
 *         return True, True, True
 */
  __pyx_tuple__118 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__118)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);

  /* "pandas/src/generated.pyx":1967
 *             return True, True, True
 *     elif n < 2:
 *         return True, True, True             # <<<<<<<<<<<<<<
 * 
 *     if timelike and arr[0] == iNaT:
 */
  __pyx_tuple__119 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__119)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);

  /* "pandas/src/generated.pyx":1970
 * 
 *     if timelike and arr[0] == iNaT:
 *         return False, False, None             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
  __pyx_tuple__120 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__120)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);

  /* "pandas/src/generated.pyx":1976
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             is_monotonic_inc = 0
 */
  __pyx_tuple__121 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__121)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);

  /* "pandas/src/generated.pyx":1985
 *         else:
 *             # cur or prev is NaN
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 */
  __pyx_tuple__122 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__122)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);

  /* "pandas/src/generated.pyx":1987
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 */
  __pyx_tuple__123 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__123)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);

  /* "pandas/src/generated.pyx":2010
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 *             return False, False, True             # <<<<<<<<<<<<<<
 *         else:
 *             return True, True, True
 */
  __pyx_tuple__124 = PyTuple_Pack(3, Py_False, Py_False, Py_True); if (unlikely(!__pyx_tuple__124)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);

  /* "pandas/src/generated.pyx":2012
 *             return False, False, True
 *         else:
 *             return True, True, True             # <<<<<<<<<<<<<<
 *     elif n < 2:
 *         return True, True, True
 */
  __pyx_tuple__125 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__125)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);

  /* "pandas/src/generated.pyx":2014
 *             return True, True, True
 *     elif n < 2:
 *         return True, True, True             # <<<<<<<<<<<<<<
 * 
 *     if timelike and arr[0] == iNaT:
 */
  __pyx_tuple__126 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__126)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);

  /* "pandas/src/generated.pyx":2017
 * 
 *     if timelike and arr[0] == iNaT:
 *         return False, False, None             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
  __pyx_tuple__127 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__127)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);

  /* "pandas/src/generated.pyx":2023
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             is_monotonic_inc = 0
 */
  __pyx_tuple__128 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__128)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);

  /* "pandas/src/generated.pyx":2032
 *         else:
 *             # cur or prev is NaN
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 */
  __pyx_tuple__129 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__129)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);

  /* "pandas/src/generated.pyx":2034
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 */
  __pyx_tuple__130 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__130)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);

  /* "pandas/src/generated.pyx":2057
 *         if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
 *             # single value is NaN
 *             return False, False, True             # <<<<<<<<<<<<<<
 *         else:
 *             return True, True, True
 */
  __pyx_tuple__131 = PyTuple_Pack(3, Py_False, Py_False, Py_True); if (unlikely(!__pyx_tuple__131)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__131);
  __Pyx_GIVEREF(__pyx_tuple__131);

  /* "pandas/src/generated.pyx":2059
 *             return False, False, True
 *         else:
 *             return True, True, True             # <<<<<<<<<<<<<<
 *     elif n < 2:
 *         return True, True, True
 */
  __pyx_tuple__132 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__132)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);

  /* "pandas/src/generated.pyx":2061
 *             return True, True, True
 *     elif n < 2:
 *         return True, True, True             # <<<<<<<<<<<<<<
 * 
 *     if timelike and arr[0] == iNaT:
 */
  __pyx_tuple__133 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__133)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);

  /* "pandas/src/generated.pyx":2064
 * 
 *     if timelike and arr[0] == iNaT:
 *         return False, False, None             # <<<<<<<<<<<<<<
 * 
 *     prev = arr[0]
 */
  __pyx_tuple__134 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__134)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);

  /* "pandas/src/generated.pyx":2070
 *         cur = arr[i]
 *         if timelike and cur == iNaT:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if cur < prev:
 *             is_monotonic_inc = 0
 */
  __pyx_tuple__135 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__135)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);

  /* "pandas/src/generated.pyx":2079
 *         else:
 *             # cur or prev is NaN
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None
 */
  __pyx_tuple__136 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__136)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);

  /* "pandas/src/generated.pyx":2081
 *             return False, False, None
 *         if not is_monotonic_inc and not is_monotonic_dec:
 *             return False, False, None             # <<<<<<<<<<<<<<
 *         prev = cur
 *     return is_monotonic_inc, is_monotonic_dec, is_unique
 */
  __pyx_tuple__137 = PyTuple_Pack(3, Py_False, Py_False, Py_None); if (unlikely(!__pyx_tuple__137)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);

  /* "pandas/src/generated.pyx":2096
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_tuple__138 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__138)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);

  /* "pandas/src/generated.pyx":2124
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_tuple__139 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__139)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);

  /* "pandas/src/generated.pyx":2152
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_tuple__140 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__140)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);

  /* "pandas/src/generated.pyx":2180
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_tuple__141 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__141)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);

  /* "pandas/src/generated.pyx":2208
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_tuple__142 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__142)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);

  /* "pandas/src/generated.pyx":2236
 * 
 *     if not length == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(length):
 */
  __pyx_tuple__143 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__143)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);

  /* "pandas/src/generated.pyx":6613
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__258 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__258)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__258);
  __Pyx_GIVEREF(__pyx_tuple__258);

  /* "pandas/src/generated.pyx":6669
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__259 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__259)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__259);
  __Pyx_GIVEREF(__pyx_tuple__259);

  /* "pandas/src/generated.pyx":6839
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__260 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__260)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__260);
  __Pyx_GIVEREF(__pyx_tuple__260);

  /* "pandas/src/generated.pyx":6895
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__261 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__261)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__261);
  __Pyx_GIVEREF(__pyx_tuple__261);

  /* "pandas/src/generated.pyx":7062
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__262 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__262)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__262);
  __Pyx_GIVEREF(__pyx_tuple__262);

  /* "pandas/src/generated.pyx":7123
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__263 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__263)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__263);
  __Pyx_GIVEREF(__pyx_tuple__263);

  /* "pandas/src/generated.pyx":7308
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__264 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__264)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__264);
  __Pyx_GIVEREF(__pyx_tuple__264);

  /* "pandas/src/generated.pyx":7360
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__265 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__265)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__265);
  __Pyx_GIVEREF(__pyx_tuple__265);

  /* "pandas/src/generated.pyx":7531
 * 
 *     if out.shape[1] != 4:
 *         raise ValueError('Output array must have 4 columns')             # <<<<<<<<<<<<<<
 * 
 *     NA = np.nan
 */
  __pyx_tuple__266 = PyTuple_Pack(1, __pyx_kp_s_Output_array_must_have_4_columns); if (unlikely(!__pyx_tuple__266)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__266);
  __Pyx_GIVEREF(__pyx_tuple__266);

  /* "pandas/src/generated.pyx":7537
 *     b = 0
 *     if K > 1:
 *         raise NotImplementedError("Argument 'values' must have only "             # <<<<<<<<<<<<<<
 *                                   "one dimension")
 *     else:
 */
  __pyx_tuple__267 = PyTuple_Pack(1, __pyx_kp_s_Argument_values_must_have_only_o); if (unlikely(!__pyx_tuple__267)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__267);
  __Pyx_GIVEREF(__pyx_tuple__267);

  /* "pandas/src/generated.pyx":7605
 * 
 *     if out.shape[1] != 4:
 *         raise ValueError('Output array must have 4 columns')             # <<<<<<<<<<<<<<
 * 
 *     NA = np.nan
 */
  __pyx_tuple__268 = PyTuple_Pack(1, __pyx_kp_s_Output_array_must_have_4_columns); if (unlikely(!__pyx_tuple__268)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__268);
  __Pyx_GIVEREF(__pyx_tuple__268);

  /* "pandas/src/generated.pyx":7611
 *     b = 0
 *     if K > 1:
 *         raise NotImplementedError("Argument 'values' must have only "             # <<<<<<<<<<<<<<
 *                                   "one dimension")
 *     else:
 */
  __pyx_tuple__269 = PyTuple_Pack(1, __pyx_kp_s_Argument_values_must_have_only_o); if (unlikely(!__pyx_tuple__269)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__269);
  __Pyx_GIVEREF(__pyx_tuple__269);

  /* "pandas/src/generated.pyx":7673
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 */
  __pyx_tuple__270 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__270)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__270);
  __Pyx_GIVEREF(__pyx_tuple__270);

  /* "pandas/src/generated.pyx":7716
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 */
  __pyx_tuple__271 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__271)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__271);
  __Pyx_GIVEREF(__pyx_tuple__271);

  /* "pandas/src/generated.pyx":7759
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 */
  __pyx_tuple__272 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__272)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__272);
  __Pyx_GIVEREF(__pyx_tuple__272);

  /* "pandas/src/generated.pyx":7936
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 */
  __pyx_tuple__273 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__273)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__273);
  __Pyx_GIVEREF(__pyx_tuple__273);

  /* "pandas/src/generated.pyx":7980
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 */
  __pyx_tuple__274 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__274)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__274);
  __Pyx_GIVEREF(__pyx_tuple__274);

  /* "pandas/src/generated.pyx":8024
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 */
  __pyx_tuple__275 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__275)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__275);
  __Pyx_GIVEREF(__pyx_tuple__275);

  /* "pandas/src/generated.pyx":8204
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__276 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__276)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__276);
  __Pyx_GIVEREF(__pyx_tuple__276);

  /* "pandas/src/generated.pyx":8264
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__277 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__277)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__277);
  __Pyx_GIVEREF(__pyx_tuple__277);

  /* "pandas/src/generated.pyx":8324
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__278 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__278)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__278);
  __Pyx_GIVEREF(__pyx_tuple__278);

  /* "pandas/src/generated.pyx":8329
 * 
 *     minx = np.empty_like(out)
 *     minx.fill(9223372036854775807)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_tuple__279 = PyTuple_Pack(1, __pyx_int_9223372036854775807); if (unlikely(!__pyx_tuple__279)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__279);
  __Pyx_GIVEREF(__pyx_tuple__279);

  /* "pandas/src/generated.pyx":8509
 * 
 *     minx = np.empty_like(out)
 *     minx.fill(9223372036854775807)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_tuple__280 = PyTuple_Pack(1, __pyx_int_9223372036854775807); if (unlikely(!__pyx_tuple__280)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__280);
  __Pyx_GIVEREF(__pyx_tuple__280);

  /* "pandas/src/generated.pyx":8569
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__281 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__281)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__281);
  __Pyx_GIVEREF(__pyx_tuple__281);

  /* "pandas/src/generated.pyx":8629
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__282 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__282)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__282);
  __Pyx_GIVEREF(__pyx_tuple__282);

  /* "pandas/src/generated.pyx":8689
 * 
 *     if not len(values) == len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     nobs = np.zeros_like(out)
 */
  __pyx_tuple__283 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__283)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__283);
  __Pyx_GIVEREF(__pyx_tuple__283);

  /* "pandas/src/generated.pyx":8694
 * 
 *     maxx = np.empty_like(out)
 *     maxx.fill(-9223372036854775807)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_tuple__284 = PyTuple_Pack(1, __pyx_int_neg_9223372036854775807); if (unlikely(!__pyx_tuple__284)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__284);
  __Pyx_GIVEREF(__pyx_tuple__284);

  /* "pandas/src/generated.pyx":8871
 *     nobs = np.zeros_like(out)
 *     maxx = np.empty_like(out)
 *     maxx.fill(-9223372036854775807)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_tuple__285 = PyTuple_Pack(1, __pyx_int_neg_9223372036854775807); if (unlikely(!__pyx_tuple__285)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__285);
  __Pyx_GIVEREF(__pyx_tuple__285);

  /* "pandas/src/generated.pyx":8933
 * 
 *     if len(values) != len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_tuple__286 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__286)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__286);
  __Pyx_GIVEREF(__pyx_tuple__286);

  /* "pandas/src/generated.pyx":8969
 * 
 *     if len(values) != len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_tuple__287 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__287)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__287);
  __Pyx_GIVEREF(__pyx_tuple__287);

  /* "pandas/src/generated.pyx":9005
 * 
 *     if len(values) != len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_tuple__288 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__288)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__288);
  __Pyx_GIVEREF(__pyx_tuple__288);

  /* "pandas/src/generated.pyx":9041
 * 
 *     if len(values) != len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_tuple__289 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__289)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__289);
  __Pyx_GIVEREF(__pyx_tuple__289);

  /* "pandas/src/generated.pyx":9077
 * 
 *     if len(values) != len(labels):
 *        raise AssertionError("len(index) != len(labels)")             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_tuple__290 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__290)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__290);
  __Pyx_GIVEREF(__pyx_tuple__290);

  /* "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__291 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__291)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__291);
  __Pyx_GIVEREF(__pyx_tuple__291);

  /* "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__292 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__292)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__292);
  __Pyx_GIVEREF(__pyx_tuple__292);

  /* "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__293 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__293)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__293);
  __Pyx_GIVEREF(__pyx_tuple__293);

  /* "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__294 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__294)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__294);
  __Pyx_GIVEREF(__pyx_tuple__294);

  /* "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__295 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__295)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__295);
  __Pyx_GIVEREF(__pyx_tuple__295);

  /* "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__296 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__296)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__296);
  __Pyx_GIVEREF(__pyx_tuple__296);

  /* "util.pxd":41
 *         i += sz
 *     elif i >= sz or sz == 0:
 *         raise IndexError('index out of bounds')             # <<<<<<<<<<<<<<
 * 
 *     return get_value_1d(arr, i)
 */
  __pyx_tuple__297 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__297)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__297);
  __Pyx_GIVEREF(__pyx_tuple__297);

  /* "util.pxd":58
 *         i += sz
 *     elif i >= sz:
 *         raise IndexError('index out of bounds')             # <<<<<<<<<<<<<<
 * 
 *     assign_value_1d(arr, i, value)
 */
  __pyx_tuple__298 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__298)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__298);
  __Pyx_GIVEREF(__pyx_tuple__298);

  /* "View.MemoryView":127
 * 
 *         if not self.ndim:
 *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         if itemsize <= 0:
 */
  __pyx_tuple__299 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__299)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__299);
  __Pyx_GIVEREF(__pyx_tuple__299);

  /* "View.MemoryView":130
 * 
 *         if itemsize <= 0:
 *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(format, unicode):
 */
  __pyx_tuple__300 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__300)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__300);
  __Pyx_GIVEREF(__pyx_tuple__300);

  /* "View.MemoryView":142
 * 
 *         if not self._shape:
 *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__301 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__301)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__301);
  __Pyx_GIVEREF(__pyx_tuple__301);

  /* "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__302 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__302)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__302);
  __Pyx_GIVEREF(__pyx_tuple__302);

  /* "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__303 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__303)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__303);
  __Pyx_GIVEREF(__pyx_tuple__303);

  /* "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__304 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__304)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__304);
  __Pyx_GIVEREF(__pyx_tuple__304);

  /* "View.MemoryView":521
 *             if self.view.strides == NULL:
 * 
 *                 raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
 * 
 *             return tuple([stride for stride in self.view.strides[:self.view.ndim]])
 */
  __pyx_tuple__305 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__305)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__305);
  __Pyx_GIVEREF(__pyx_tuple__305);

  /* "View.MemoryView":529
 *         def __get__(self):
 *             if self.view.suboffsets == NULL:
 *                 return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *             return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
 */
  __pyx_tuple__306 = PyTuple_New(1); if (unlikely(!__pyx_tuple__306)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__306);
  __Pyx_INCREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_tuple__306, 0, __pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_tuple__306);

  /* "View.MemoryView":638
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
 *                 seen_ellipsis = True
 *             else:
 */
  __pyx_slice__307 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__307)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__307);
  __Pyx_GIVEREF(__pyx_slice__307);

  /* "View.MemoryView":641
 *                 seen_ellipsis = True
 *             else:
 *                 result.append(slice(None))             # <<<<<<<<<<<<<<
 *             have_slices = True
 *         else:
 */
  __pyx_slice__308 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__308)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__308);
  __Pyx_GIVEREF(__pyx_slice__308);

  /* "View.MemoryView":652
 *     nslices = ndim - len(result)
 *     if nslices:
 *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
 * 
 *     return have_slices or nslices, tuple(result)
 */
  __pyx_slice__309 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__309)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__309);
  __Pyx_GIVEREF(__pyx_slice__309);

  /* "View.MemoryView":659
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
 *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__310 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__310)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__310);
  __Pyx_GIVEREF(__pyx_tuple__310);

  /* "pandas/algos.pyx":138
 * 
 * 
 * def rank_1d_float64(object in_arr, ties_method='average', ascending=True,             # <<<<<<<<<<<<<<
 *                     na_option='keep', pct=False):
 *     """
 */
  __pyx_tuple__311 = 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__311)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__311);
  __Pyx_GIVEREF(__pyx_tuple__311);
  __pyx_codeobj__312 = (PyObject*)__Pyx_PyCode_New(5, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__311, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_rank_1d_float64, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__312)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":219
 * 
 * 
 * def rank_1d_int64(object in_arr, ties_method='average', ascending=True,             # <<<<<<<<<<<<<<
 *                   na_option='keep', pct=False):
 *     """
 */
  __pyx_tuple__313 = 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__313)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__313);
  __Pyx_GIVEREF(__pyx_tuple__313);
  __pyx_codeobj__314 = (PyObject*)__Pyx_PyCode_New(5, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__313, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_rank_1d_int64, 219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__314)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":288
 * 
 * 
 * def rank_2d_float64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */
  __pyx_tuple__315 = 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__315)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__315);
  __Pyx_GIVEREF(__pyx_tuple__315);
  __pyx_codeobj__316 = (PyObject*)__Pyx_PyCode_New(6, 0, 23, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__315, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_rank_2d_float64, 288, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__316)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":380
 * 
 * 
 * def rank_2d_int64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */
  __pyx_tuple__317 = 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__317)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__317);
  __Pyx_GIVEREF(__pyx_tuple__317);
  __pyx_codeobj__318 = (PyObject*)__Pyx_PyCode_New(6, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__317, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_rank_2d_int64, 380, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__318)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":457
 * 
 * 
 * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */
  __pyx_tuple__319 = 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__319)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__319);
  __Pyx_GIVEREF(__pyx_tuple__319);
  __pyx_codeobj__320 = (PyObject*)__Pyx_PyCode_New(6, 0, 24, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__319, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_rank_1d_generic, 457, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__320)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":575
 *     __cmp__ = _return_true
 * 
 * def rank_2d_generic(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */
  __pyx_tuple__321 = 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__321)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__321);
  __Pyx_GIVEREF(__pyx_tuple__321);
  __pyx_codeobj__322 = (PyObject*)__Pyx_PyCode_New(6, 0, 25, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__321, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_rank_2d_generic, 575, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__322)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":702
 * # -
 * 
 * def _check_minp(win, minp, N, floor=1):             # <<<<<<<<<<<<<<
 *     if minp > win:
 *         raise ValueError('min_periods (%d) must be <= window (%d)'
 */
  __pyx_tuple__323 = PyTuple_Pack(4, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_N, __pyx_n_s_floor); if (unlikely(!__pyx_tuple__323)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__323);
  __Pyx_GIVEREF(__pyx_tuple__323);
  __pyx_codeobj__324 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__323, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_check_minp, 702, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__324)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":755
 * @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__325 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_k); if (unlikely(!__pyx_tuple__325)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__325);
  __Pyx_GIVEREF(__pyx_tuple__325);
  __pyx_codeobj__326 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__325, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_pyx_fuse_0kth_smallest, 755, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__326)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":808
 * 
 * 
 * cpdef numeric median(numeric[:] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */
  __pyx_tuple__327 = PyTuple_Pack(2, __pyx_n_s_arr, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__327)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__327);
  __Pyx_GIVEREF(__pyx_tuple__327);
  __pyx_codeobj__328 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__327, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_pyx_fuse_0median, 808, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__328)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":828
 * # -------------- Min, Max subsequence
 * 
 * def max_subseq(ndarray[double_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i=0,s=0,e=0,T,n
 */
  __pyx_tuple__329 = 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__329)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__329);
  __Pyx_GIVEREF(__pyx_tuple__329);
  __pyx_codeobj__330 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__329, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_max_subseq, 828, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__330)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":856
 *     return (s, e, m)
 * 
 * def min_subseq(ndarray[double_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t s, e
 */
  __pyx_tuple__331 = PyTuple_Pack(4, __pyx_n_s_arr, __pyx_n_s_s, __pyx_n_s_e, __pyx_n_s_m); if (unlikely(!__pyx_tuple__331)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__331);
  __Pyx_GIVEREF(__pyx_tuple__331);
  __pyx_codeobj__332 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__331, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_min_subseq, 856, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__332)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":868
 * # 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__333 = 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__333)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__333);
  __Pyx_GIVEREF(__pyx_tuple__333);
  __pyx_codeobj__334 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__333, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_roll_sum, 868, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__334)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":910
 * # Rolling mean
 * 
 * def roll_mean(ndarray[double_t] input,             # <<<<<<<<<<<<<<
 *                int win, int minp):
 *     cdef:
 */
  __pyx_tuple__335 = 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__335)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__335);
  __Pyx_GIVEREF(__pyx_tuple__335);
  __pyx_codeobj__336 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__335, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_roll_mean, 910, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__336)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":967
 * # Exponentially weighted moving average
 * 
 * def ewma(ndarray[double_t] input, double_t com, int adjust, int ignore_na, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     Compute exponentially-weighted moving average using center-of-mass.
 */
  __pyx_tuple__337 = PyTuple_Pack(16, __pyx_n_s_input, __pyx_n_s_com, __pyx_n_s_adjust, __pyx_n_s_ignore_na, __pyx_n_s_minp, __pyx_n_s_N, __pyx_n_s_output, __pyx_n_s_alpha, __pyx_n_s_old_wt_factor, __pyx_n_s_new_wt, __pyx_n_s_weighted_avg, __pyx_n_s_old_wt, __pyx_n_s_cur, __pyx_n_s_i, __pyx_n_s_nobs, __pyx_n_s_is_observation); if (unlikely(!__pyx_tuple__337)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__337);
  __Pyx_GIVEREF(__pyx_tuple__337);
  __pyx_codeobj__338 = (PyObject*)__Pyx_PyCode_New(5, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__337, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_ewma, 967, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__338)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1028
 * # Exponentially weighted moving covariance
 * 
 * def ewmcov(ndarray[double_t] input_x, ndarray[double_t] input_y,             # <<<<<<<<<<<<<<
 *            double_t com, int adjust, int ignore_na, int minp, int bias):
 *     '''
 */
  __pyx_tuple__339 = PyTuple_Pack(27, __pyx_n_s_input_x, __pyx_n_s_input_y, __pyx_n_s_com, __pyx_n_s_adjust, __pyx_n_s_ignore_na, __pyx_n_s_minp, __pyx_n_s_bias, __pyx_n_s_N, __pyx_n_s_output, __pyx_n_s_alpha, __pyx_n_s_old_wt_factor, __pyx_n_s_new_wt, __pyx_n_s_mean_x, __pyx_n_s_mean_y, __pyx_n_s_cov, __pyx_n_s_sum_wt, __pyx_n_s_sum_wt2, __pyx_n_s_old_wt, __pyx_n_s_cur_x, __pyx_n_s_cur_y, __pyx_n_s_old_mean_x, __pyx_n_s_old_mean_y, __pyx_n_s_i, __pyx_n_s_nobs, __pyx_n_s_is_observation, __pyx_n_s_numerator, __pyx_n_s_denominator); if (unlikely(!__pyx_tuple__339)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__339);
  __Pyx_GIVEREF(__pyx_tuple__339);
  __pyx_codeobj__340 = (PyObject*)__Pyx_PyCode_New(7, 0, 27, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__339, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_ewmcov, 1028, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__340)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1125
 * @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__341 = 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__341)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__341);
  __Pyx_GIVEREF(__pyx_tuple__341);
  __pyx_codeobj__342 = (PyObject*)__Pyx_PyCode_New(3, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__341, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_nancorr, 1125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__342)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1184
 * @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__343 = 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__343)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__343);
  __Pyx_GIVEREF(__pyx_tuple__343);
  __pyx_codeobj__344 = (PyObject*)__Pyx_PyCode_New(2, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__343, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_nancorr_spearman, 1184, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__344)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1245
 * # 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__345 = 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__345)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__345);
  __Pyx_GIVEREF(__pyx_tuple__345);
  __pyx_codeobj__346 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__345, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_roll_var, 1245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__346)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1334
 * # 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__347 = 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__347)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__347);
  __Pyx_GIVEREF(__pyx_tuple__347);
  __pyx_codeobj__348 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__347, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_roll_skew, 1334, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__348)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1395
 * 
 * 
 * def roll_kurt(ndarray[double_t] input,             # <<<<<<<<<<<<<<
 *                int win, int minp):
 *     cdef double val, prev
 */
  __pyx_tuple__349 = 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__349)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__349);
  __Pyx_GIVEREF(__pyx_tuple__349);
  __pyx_codeobj__350 = (PyObject*)__Pyx_PyCode_New(3, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__349, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_roll_kurt, 1395, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__350)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1515
 * from skiplist cimport *
 * 
 * def roll_median_c(ndarray[float64_t] arg, int win, int minp):             # <<<<<<<<<<<<<<
 *     cdef double val, res, prev
 *     cdef:
 */
  __pyx_tuple__351 = 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__351)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__351);
  __Pyx_GIVEREF(__pyx_tuple__351);
  __pyx_codeobj__352 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__351, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_roll_median_c, 1515, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__352)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1570
 *     return output
 * 
 * def roll_median_cython(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */
  __pyx_tuple__353 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp); if (unlikely(!__pyx_tuple__353)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__353);
  __Pyx_GIVEREF(__pyx_tuple__353);
  __pyx_codeobj__354 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__353, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_roll_median_cython, 1570, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__354)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1606
 * @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__355 = 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__355)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__355);
  __Pyx_GIVEREF(__pyx_tuple__355);
  __pyx_codeobj__356 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__355, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_roll_max2, 1606, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__356)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1684
 *     return y
 * 
 * def roll_max(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */
  __pyx_tuple__357 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp); if (unlikely(!__pyx_tuple__357)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__357);
  __Pyx_GIVEREF(__pyx_tuple__357);
  __pyx_codeobj__358 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__357, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_roll_max, 1684, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__358)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1697
 *         return NaN
 * 
 * def roll_min(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */
  __pyx_tuple__359 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp); if (unlikely(!__pyx_tuple__359)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__359);
  __Pyx_GIVEREF(__pyx_tuple__359);
  __pyx_codeobj__360 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__359, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_roll_min, 1697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__360)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1705
 * @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__361 = 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__361)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__361);
  __Pyx_GIVEREF(__pyx_tuple__361);
  __pyx_codeobj__362 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__361, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_roll_min2, 1705, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__362)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1789
 *         return NaN
 * 
 * def roll_quantile(ndarray[float64_t, cast=True] input, int win,             # <<<<<<<<<<<<<<
 *                   int minp, double quantile):
 *     '''
 */
  __pyx_tuple__363 = 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__363)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__363);
  __Pyx_GIVEREF(__pyx_tuple__363);
  __pyx_codeobj__364 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__363, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_roll_quantile, 1789, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__364)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1836
 *     return output
 * 
 * def roll_generic(ndarray[float64_t, cast=True] input,             # <<<<<<<<<<<<<<
 *                  int win, int minp, int offset,
 *                  object func, object args, object kwargs):
 */
  __pyx_tuple__365 = PyTuple_Pack(14, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_offset, __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__365)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__365);
  __Pyx_GIVEREF(__pyx_tuple__365);
  __pyx_codeobj__366 = (PyObject*)__Pyx_PyCode_New(7, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__365, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_roll_generic, 1836, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__366)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1885
 * 
 * 
 * def roll_window(ndarray[float64_t, ndim=1, cast=True] input,             # <<<<<<<<<<<<<<
 *                 ndarray[float64_t, ndim=1, cast=True] weights,
 *                 int minp, bint avg=True):
 */
  __pyx_tuple__367 = PyTuple_Pack(17, __pyx_n_s_input, __pyx_n_s_weights, __pyx_n_s_minp, __pyx_n_s_avg, __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__367)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__367);
  __Pyx_GIVEREF(__pyx_tuple__367);
  __pyx_codeobj__368 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__367, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_roll_window, 1885, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__368)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1956
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def is_lexsorted(list list_of_arrays):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int i
 */
  __pyx_tuple__369 = 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__369)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__369);
  __Pyx_GIVEREF(__pyx_tuple__369);
  __pyx_codeobj__370 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__369, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_is_lexsorted, 1956, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__370)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":1989
 * 
 * @cython.boundscheck(False)
 * def groupby_indices(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_tuple__371 = 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__371)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__371);
  __Pyx_GIVEREF(__pyx_tuple__371);
  __pyx_codeobj__372 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__371, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_groupby_indices, 1989, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__372)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":2026
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_labels(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     '''
 *     Compute label vector from input values and associated useful data
 */
  __pyx_tuple__373 = 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__373)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__373);
  __Pyx_GIVEREF(__pyx_tuple__373);
  __pyx_codeobj__374 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__373, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_group_labels, 2026, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__374)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":2068
 * @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__375 = 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__375)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__375);
  __Pyx_GIVEREF(__pyx_tuple__375);
  __pyx_codeobj__376 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__375, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_groupsort_indexer, 2068, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__376)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":2099
 * @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__377 = 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__377)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__377);
  __Pyx_GIVEREF(__pyx_tuple__377);
  __pyx_codeobj__378 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__377, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_group_nth_object, 2099, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__378)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":2143
 * @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__379 = 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__379)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__379);
  __Pyx_GIVEREF(__pyx_tuple__379);
  __pyx_codeobj__380 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__379, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_group_nth_bin_object, 2143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__380)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":2191
 * @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__381 = 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__381)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__381);
  __Pyx_GIVEREF(__pyx_tuple__381);
  __pyx_codeobj__382 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__381, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_group_last_object, 2191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__382)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":2233
 * @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__383 = 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__383)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__383);
  __Pyx_GIVEREF(__pyx_tuple__383);
  __pyx_codeobj__384 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__383, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_group_last_bin_object, 2233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__384)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/algos.pyx":2283
 * # median
 * 
 * def group_median(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                  ndarray[int64_t] counts,
 *                  ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__385 = 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__385)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__385);
  __Pyx_GIVEREF(__pyx_tuple__385);
  __pyx_codeobj__386 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__385, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_alg, __pyx_n_s_group_median, 2283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__386)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2283; __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__387 = 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__387)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__387);
  __Pyx_GIVEREF(__pyx_tuple__387);
  __pyx_codeobj__388 = (PyObject*)__Pyx_PyCode_New(3, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__387, __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__388)) {__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__390 = PyTuple_Pack(23, __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, __pyx_n_s__389); if (unlikely(!__pyx_tuple__390)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__390);
  __Pyx_GIVEREF(__pyx_tuple__390);
  __pyx_codeobj__391 = (PyObject*)__Pyx_PyCode_New(4, 0, 23, 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_join_pyx, __pyx_n_s_left_outer_join, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__391)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/join.pyx":128
 * 
 * 
 * def full_outer_join(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                           Py_ssize_t max_groups):
 *     cdef:
 */
  __pyx_tuple__392 = 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__392)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__392);
  __Pyx_GIVEREF(__pyx_tuple__392);
  __pyx_codeobj__393 = (PyObject*)__Pyx_PyCode_New(3, 0, 19, 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_join_pyx, __pyx_n_s_full_outer_join, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__393)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/join.pyx":192
 * 
 * 
 * def _get_result_indexer(sorter, indexer):             # <<<<<<<<<<<<<<
 *     if indexer.dtype != np.int_:
 *         indexer = indexer.astype(np.int_)
 */
  __pyx_tuple__394 = PyTuple_Pack(3, __pyx_n_s_sorter, __pyx_n_s_indexer, __pyx_n_s_res); if (unlikely(!__pyx_tuple__394)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__394);
  __Pyx_GIVEREF(__pyx_tuple__394);
  __pyx_codeobj__395 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 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_join_pyx, __pyx_n_s_get_result_indexer, 192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__395)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/join.pyx":207
 * 
 * 
 * def ffill_indexer(ndarray[int64_t] indexer):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(indexer)
 */
  __pyx_tuple__396 = 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__396)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; __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_join_pyx, __pyx_n_s_ffill_indexer, 207, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__397)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/join.pyx":227
 * 
 * 
 * def ffill_by_group(ndarray[int64_t] indexer, ndarray[int64_t] group_ids,             # <<<<<<<<<<<<<<
 *                    int64_t max_group):
 *     cdef:
 */
  __pyx_tuple__398 = 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__398)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__398);
  __Pyx_GIVEREF(__pyx_tuple__398);
  __pyx_codeobj__399 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 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_join_pyx, __pyx_n_s_ffill_by_group, 227, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__399)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":43
 * import_ufunc()
 * 
 * cdef int PLATFORM_INT = (<ndarray> np.arange(0, dtype=np.int_)).descr.type_num             # <<<<<<<<<<<<<<
 * 
 * cpdef ensure_platform_int(object arr):
 */
  __pyx_tuple__400 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__400)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__400);
  __Pyx_GIVEREF(__pyx_tuple__400);

  /* "pandas/src/generated.pyx":262
 * @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__401 = 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__401)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__401);
  __Pyx_GIVEREF(__pyx_tuple__401);
  __pyx_codeobj__402 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__401, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_float64, 262, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__402)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":323
 * @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__403 = 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__403)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__403);
  __Pyx_GIVEREF(__pyx_tuple__403);
  __pyx_codeobj__404 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__403, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_float32, 323, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__404)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":384
 * @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__405 = 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__405)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__405);
  __Pyx_GIVEREF(__pyx_tuple__405);
  __pyx_codeobj__406 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__405, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_object, 384, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__406)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":445
 * @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__407 = 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__407)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__407);
  __Pyx_GIVEREF(__pyx_tuple__407);
  __pyx_codeobj__408 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__407, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_int32, 445, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__408)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":506
 * @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__409 = 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__409)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__409);
  __Pyx_GIVEREF(__pyx_tuple__409);
  __pyx_codeobj__410 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__409, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_int64, 506, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__410)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":567
 * @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__411 = 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__411)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__411);
  __Pyx_GIVEREF(__pyx_tuple__411);
  __pyx_codeobj__412 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__411, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_bool, 567, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__412)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":629
 * @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__413 = 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__413)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__413);
  __Pyx_GIVEREF(__pyx_tuple__413);
  __pyx_codeobj__414 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__413, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_float64, 629, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__414)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":691
 * @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__415 = 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__415)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__415);
  __Pyx_GIVEREF(__pyx_tuple__415);
  __pyx_codeobj__416 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__415, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_float32, 691, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__416)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":753
 * @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__417 = 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__417)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__417);
  __Pyx_GIVEREF(__pyx_tuple__417);
  __pyx_codeobj__418 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__417, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_object, 753, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__418)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":815
 * @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__419 = 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__419)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__419);
  __Pyx_GIVEREF(__pyx_tuple__419);
  __pyx_codeobj__420 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__419, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_int32, 815, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__420)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":877
 * @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__421 = 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__421)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__421);
  __Pyx_GIVEREF(__pyx_tuple__421);
  __pyx_codeobj__422 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__421, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_int64, 877, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__422)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":939
 * @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__423 = 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__423)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__423);
  __Pyx_GIVEREF(__pyx_tuple__423);
  __pyx_codeobj__424 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__423, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_bool, 939, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__424)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1002
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_tuple__425 = 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__425)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__425);
  __Pyx_GIVEREF(__pyx_tuple__425);
  __pyx_codeobj__426 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__425, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_float64, 1002, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__426)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1035
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_tuple__427 = 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__427)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__427);
  __Pyx_GIVEREF(__pyx_tuple__427);
  __pyx_codeobj__428 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__427, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_float32, 1035, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__428)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1068
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_tuple__429 = 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__429)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__429);
  __Pyx_GIVEREF(__pyx_tuple__429);
  __pyx_codeobj__430 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__429, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_object, 1068, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__430)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1101
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_tuple__431 = 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__431)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__431);
  __Pyx_GIVEREF(__pyx_tuple__431);
  __pyx_codeobj__432 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__431, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_int32, 1101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__432)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1134
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_tuple__433 = 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__433)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__433);
  __Pyx_GIVEREF(__pyx_tuple__433);
  __pyx_codeobj__434 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__433, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_int64, 1134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__434)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1167
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_tuple__435 = 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__435)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__435);
  __Pyx_GIVEREF(__pyx_tuple__435);
  __pyx_codeobj__436 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__435, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_bool, 1167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__436)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1201
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_tuple__437 = 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__437)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__437);
  __Pyx_GIVEREF(__pyx_tuple__437);
  __pyx_codeobj__438 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__437, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_float64, 1201, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__438)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1233
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_tuple__439 = 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__439)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__439);
  __Pyx_GIVEREF(__pyx_tuple__439);
  __pyx_codeobj__440 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__439, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_float32, 1233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__440)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1265
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_tuple__441 = 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__441)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__441);
  __Pyx_GIVEREF(__pyx_tuple__441);
  __pyx_codeobj__442 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__441, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_object, 1265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__442)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1297
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_tuple__443 = 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__443)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__443);
  __Pyx_GIVEREF(__pyx_tuple__443);
  __pyx_codeobj__444 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__443, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_int32, 1297, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__444)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1329
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_tuple__445 = 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__445)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__445);
  __Pyx_GIVEREF(__pyx_tuple__445);
  __pyx_codeobj__446 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__445, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_int64, 1329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__446)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1361
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_tuple__447 = 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__447)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__447);
  __Pyx_GIVEREF(__pyx_tuple__447);
  __pyx_codeobj__448 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__447, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_bool, 1361, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__448)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1394
 * @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__449 = 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__449)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__449);
  __Pyx_GIVEREF(__pyx_tuple__449);
  __pyx_codeobj__450 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__449, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_float64, 1394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__450)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1428
 * @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__451 = 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__451)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__451);
  __Pyx_GIVEREF(__pyx_tuple__451);
  __pyx_codeobj__452 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__451, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_float32, 1428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__452)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1462
 * @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__453 = 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__453)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__453);
  __Pyx_GIVEREF(__pyx_tuple__453);
  __pyx_codeobj__454 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__453, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_object, 1462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__454)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1496
 * @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__455 = 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__455)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__455);
  __Pyx_GIVEREF(__pyx_tuple__455);
  __pyx_codeobj__456 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__455, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_int32, 1496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__456)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1530
 * @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__457 = 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__457)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__457);
  __Pyx_GIVEREF(__pyx_tuple__457);
  __pyx_codeobj__458 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__457, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_int64, 1530, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__458)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1564
 * @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__459 = 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__459)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__459);
  __Pyx_GIVEREF(__pyx_tuple__459);
  __pyx_codeobj__460 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__459, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_bool, 1564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__460)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1599
 * @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__461 = 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__461)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__461);
  __Pyx_GIVEREF(__pyx_tuple__461);
  __pyx_codeobj__462 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__461, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_float64, 1599, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__462)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1633
 * @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__463 = 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__463)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__463);
  __Pyx_GIVEREF(__pyx_tuple__463);
  __pyx_codeobj__464 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__463, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_float32, 1633, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__464)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1667
 * @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__465 = 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__465)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__465);
  __Pyx_GIVEREF(__pyx_tuple__465);
  __pyx_codeobj__466 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__465, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_object, 1667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__466)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1701
 * @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__467 = 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__467)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__467);
  __Pyx_GIVEREF(__pyx_tuple__467);
  __pyx_codeobj__468 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__467, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_int32, 1701, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__468)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1735
 * @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__469 = 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__469)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__469);
  __Pyx_GIVEREF(__pyx_tuple__469);
  __pyx_codeobj__470 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__469, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_int64, 1735, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__470)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1769
 * @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__471 = 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__471)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__471);
  __Pyx_GIVEREF(__pyx_tuple__471);
  __pyx_codeobj__472 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__471, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_bool, 1769, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__472)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1804
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_float64(ndarray[float64_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_tuple__473 = PyTuple_Pack(9, __pyx_n_s_arr, __pyx_n_s_timelike, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique, __pyx_n_s_is_monotonic_inc, __pyx_n_s_is_monotonic_dec); if (unlikely(!__pyx_tuple__473)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__473);
  __Pyx_GIVEREF(__pyx_tuple__473);
  __pyx_codeobj__474 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__473, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_float64, 1804, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__474)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1851
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_float32(ndarray[float32_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_tuple__475 = PyTuple_Pack(9, __pyx_n_s_arr, __pyx_n_s_timelike, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique, __pyx_n_s_is_monotonic_inc, __pyx_n_s_is_monotonic_dec); if (unlikely(!__pyx_tuple__475)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__475);
  __Pyx_GIVEREF(__pyx_tuple__475);
  __pyx_codeobj__476 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__475, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_float32, 1851, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__476)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1898
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_object(ndarray[object] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_tuple__477 = PyTuple_Pack(9, __pyx_n_s_arr, __pyx_n_s_timelike, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique, __pyx_n_s_is_monotonic_inc, __pyx_n_s_is_monotonic_dec); if (unlikely(!__pyx_tuple__477)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__477);
  __Pyx_GIVEREF(__pyx_tuple__477);
  __pyx_codeobj__478 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__477, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_object, 1898, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__478)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1945
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_int32(ndarray[int32_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_tuple__479 = PyTuple_Pack(9, __pyx_n_s_arr, __pyx_n_s_timelike, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique, __pyx_n_s_is_monotonic_inc, __pyx_n_s_is_monotonic_dec); if (unlikely(!__pyx_tuple__479)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__479);
  __Pyx_GIVEREF(__pyx_tuple__479);
  __pyx_codeobj__480 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__479, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_int32, 1945, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__480)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":1992
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_int64(ndarray[int64_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_tuple__481 = PyTuple_Pack(9, __pyx_n_s_arr, __pyx_n_s_timelike, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique, __pyx_n_s_is_monotonic_inc, __pyx_n_s_is_monotonic_dec); if (unlikely(!__pyx_tuple__481)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__481);
  __Pyx_GIVEREF(__pyx_tuple__481);
  __pyx_codeobj__482 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__481, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_int64, 1992, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__482)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2039
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_bool(ndarray[uint8_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_tuple__483 = PyTuple_Pack(9, __pyx_n_s_arr, __pyx_n_s_timelike, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique, __pyx_n_s_is_monotonic_inc, __pyx_n_s_is_monotonic_dec); if (unlikely(!__pyx_tuple__483)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__483);
  __Pyx_GIVEREF(__pyx_tuple__483);
  __pyx_codeobj__484 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__483, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_bool, 2039, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__484)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2087
 * @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__485 = 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__485)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__485);
  __Pyx_GIVEREF(__pyx_tuple__485);
  __pyx_codeobj__486 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__485, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_float64, 2087, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__486)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2115
 * @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__487 = 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__487)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__487);
  __Pyx_GIVEREF(__pyx_tuple__487);
  __pyx_codeobj__488 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__487, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_float32, 2115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__488)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2143
 * @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__489 = 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__489)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__489);
  __Pyx_GIVEREF(__pyx_tuple__489);
  __pyx_codeobj__490 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__489, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_object, 2143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__490)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2171
 * @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__491 = 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__491)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__491);
  __Pyx_GIVEREF(__pyx_tuple__491);
  __pyx_codeobj__492 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__491, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_int32, 2171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__492)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2199
 * @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__493 = 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__493)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__493);
  __Pyx_GIVEREF(__pyx_tuple__493);
  __pyx_codeobj__494 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__493, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_int64, 2199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__494)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2227
 * @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__495 = 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__495)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__495);
  __Pyx_GIVEREF(__pyx_tuple__495);
  __pyx_codeobj__496 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__495, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_bool, 2227, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__496)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2256
 * @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__497 = 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__497)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__497);
  __Pyx_GIVEREF(__pyx_tuple__497);
  __pyx_codeobj__498 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__497, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_float64, 2256, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__498)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2271
 * @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__499 = 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__499)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__499);
  __Pyx_GIVEREF(__pyx_tuple__499);
  __pyx_codeobj__500 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__499, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_float32, 2271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__500)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2286
 * @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__501 = 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__501)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__501);
  __Pyx_GIVEREF(__pyx_tuple__501);
  __pyx_codeobj__502 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__501, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_object, 2286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__502)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2301
 * @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__503 = 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__503)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__503);
  __Pyx_GIVEREF(__pyx_tuple__503);
  __pyx_codeobj__504 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__503, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_int32, 2301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__504)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2316
 * @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__505 = 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__505)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__505);
  __Pyx_GIVEREF(__pyx_tuple__505);
  __pyx_codeobj__506 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__505, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_int64, 2316, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__506)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2331
 * @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__507 = 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__507)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__507);
  __Pyx_GIVEREF(__pyx_tuple__507);
  __pyx_codeobj__508 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__507, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_bool, 2331, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__508)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2346
 * 
 * @cython.wraparound(False)
 * def take_1d_bool_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[uint8_t] out,
 */
  __pyx_tuple__509 = 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__509)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__509);
  __Pyx_GIVEREF(__pyx_tuple__509);
  __pyx_codeobj__510 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__509, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_bool_bool, 2346, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__510)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2365
 * 
 * @cython.wraparound(False)
 * def take_1d_bool_object(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[object] out,
 */
  __pyx_tuple__511 = 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__511)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__511);
  __Pyx_GIVEREF(__pyx_tuple__511);
  __pyx_codeobj__512 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__511, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_bool_object, 2365, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__512)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2384
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int8(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int8_t] out,
 */
  __pyx_tuple__513 = 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__513)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__513);
  __Pyx_GIVEREF(__pyx_tuple__513);
  __pyx_codeobj__514 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__513, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int8_int8, 2384, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__514)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2403
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int32(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */
  __pyx_tuple__515 = 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__515)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__515);
  __Pyx_GIVEREF(__pyx_tuple__515);
  __pyx_codeobj__516 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__515, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int8_int32, 2403, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__516)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2422
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int64(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */
  __pyx_tuple__517 = 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__517)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__517);
  __Pyx_GIVEREF(__pyx_tuple__517);
  __pyx_codeobj__518 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__517, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int8_int64, 2422, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__518)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2441
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_float64(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_tuple__519 = 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__519)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__519);
  __Pyx_GIVEREF(__pyx_tuple__519);
  __pyx_codeobj__520 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__519, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int8_float64, 2441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__520)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2460
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int16(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int16_t] out,
 */
  __pyx_tuple__521 = 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__521)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__521);
  __Pyx_GIVEREF(__pyx_tuple__521);
  __pyx_codeobj__522 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__521, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int16_int16, 2460, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__522)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2479
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int32(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */
  __pyx_tuple__523 = 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__523)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__523);
  __Pyx_GIVEREF(__pyx_tuple__523);
  __pyx_codeobj__524 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__523, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int16_int32, 2479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__524)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2498
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int64(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */
  __pyx_tuple__525 = 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__525)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__525);
  __Pyx_GIVEREF(__pyx_tuple__525);
  __pyx_codeobj__526 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__525, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int16_int64, 2498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__526)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2517
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_float64(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_tuple__527 = 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__527)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__527);
  __Pyx_GIVEREF(__pyx_tuple__527);
  __pyx_codeobj__528 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__527, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int16_float64, 2517, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__528)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2536
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */
  __pyx_tuple__529 = 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__529)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__529);
  __Pyx_GIVEREF(__pyx_tuple__529);
  __pyx_codeobj__530 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__529, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int32_int32, 2536, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__530)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2555
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_int64(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */
  __pyx_tuple__531 = 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__531)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__531);
  __Pyx_GIVEREF(__pyx_tuple__531);
  __pyx_codeobj__532 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__531, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int32_int64, 2555, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__532)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2574
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_float64(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_tuple__533 = 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__533)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__533);
  __Pyx_GIVEREF(__pyx_tuple__533);
  __pyx_codeobj__534 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__533, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int32_float64, 2574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__534)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2593
 * 
 * @cython.wraparound(False)
 * def take_1d_int64_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */
  __pyx_tuple__535 = 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__535)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__535);
  __Pyx_GIVEREF(__pyx_tuple__535);
  __pyx_codeobj__536 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__535, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int64_int64, 2593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__536)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2612
 * 
 * @cython.wraparound(False)
 * def take_1d_int64_float64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_tuple__537 = 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__537)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__537);
  __Pyx_GIVEREF(__pyx_tuple__537);
  __pyx_codeobj__538 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__537, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int64_float64, 2612, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__538)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2631
 * 
 * @cython.wraparound(False)
 * def take_1d_float32_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float32_t] out,
 */
  __pyx_tuple__539 = 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__539)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__539);
  __Pyx_GIVEREF(__pyx_tuple__539);
  __pyx_codeobj__540 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__539, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_float32_float32, 2631, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__540)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2650
 * 
 * @cython.wraparound(False)
 * def take_1d_float32_float64(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_tuple__541 = 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__541)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__541);
  __Pyx_GIVEREF(__pyx_tuple__541);
  __pyx_codeobj__542 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__541, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_float32_float64, 2650, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__542)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2669
 * 
 * @cython.wraparound(False)
 * def take_1d_float64_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_tuple__543 = 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__543)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__543);
  __Pyx_GIVEREF(__pyx_tuple__543);
  __pyx_codeobj__544 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__543, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_float64_float64, 2669, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__544)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2688
 * 
 * @cython.wraparound(False)
 * def take_1d_object_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[object] out,
 */
  __pyx_tuple__545 = 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__545)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__545);
  __Pyx_GIVEREF(__pyx_tuple__545);
  __pyx_codeobj__546 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__545, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_object_object, 2688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__546)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2756
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_bool_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 */
  __pyx_tuple__547 = 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__547)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__547);
  __Pyx_GIVEREF(__pyx_tuple__547);
  __pyx_codeobj__548 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__547, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_bool_bool, 2756, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__548)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2857
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_bool_object(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */
  __pyx_tuple__549 = 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__549)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__549);
  __Pyx_GIVEREF(__pyx_tuple__549);
  __pyx_codeobj__550 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__549, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_bool_object, 2857, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__550)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":2958
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int8(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 */
  __pyx_tuple__551 = 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__551)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__551);
  __Pyx_GIVEREF(__pyx_tuple__551);
  __pyx_codeobj__552 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__551, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int8_int8, 2958, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__552)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3059
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int32(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_tuple__553 = 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__553)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__553);
  __Pyx_GIVEREF(__pyx_tuple__553);
  __pyx_codeobj__554 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__553, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int8_int32, 3059, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__554)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3160
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_tuple__555 = 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__555)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__555);
  __Pyx_GIVEREF(__pyx_tuple__555);
  __pyx_codeobj__556 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__555, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int8_int64, 3160, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__556)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3261
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_float64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__557 = 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__557)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__557);
  __Pyx_GIVEREF(__pyx_tuple__557);
  __pyx_codeobj__558 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__557, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int8_float64, 3261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__558)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3362
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int16(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 */
  __pyx_tuple__559 = 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__559)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__559);
  __Pyx_GIVEREF(__pyx_tuple__559);
  __pyx_codeobj__560 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__559, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int16_int16, 3362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__560)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3463
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int32(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_tuple__561 = 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__561)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__561);
  __Pyx_GIVEREF(__pyx_tuple__561);
  __pyx_codeobj__562 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__561, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int16_int32, 3463, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__562)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3564
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_tuple__563 = 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__563)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__563);
  __Pyx_GIVEREF(__pyx_tuple__563);
  __pyx_codeobj__564 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__563, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int16_int64, 3564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__564)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3665
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_float64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__565 = 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__565)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__565);
  __Pyx_GIVEREF(__pyx_tuple__565);
  __pyx_codeobj__566 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__565, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int16_float64, 3665, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__566)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3766
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_tuple__567 = 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__567)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__567);
  __Pyx_GIVEREF(__pyx_tuple__567);
  __pyx_codeobj__568 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__567, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int32_int32, 3766, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__568)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3867
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_int64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_tuple__569 = 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__569)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__569);
  __Pyx_GIVEREF(__pyx_tuple__569);
  __pyx_codeobj__570 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__569, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int32_int64, 3867, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__570)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":3968
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_float64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__571 = 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__571)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__571);
  __Pyx_GIVEREF(__pyx_tuple__571);
  __pyx_codeobj__572 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__571, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int32_float64, 3968, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__572)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4069
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int64_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_tuple__573 = 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__573)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__573);
  __Pyx_GIVEREF(__pyx_tuple__573);
  __pyx_codeobj__574 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__573, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int64_int64, 4069, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__574)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4170
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int64_float64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__575 = 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__575)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__575);
  __Pyx_GIVEREF(__pyx_tuple__575);
  __pyx_codeobj__576 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__575, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int64_float64, 4170, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__576)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4271
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float32_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 */
  __pyx_tuple__577 = 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__577)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__577);
  __Pyx_GIVEREF(__pyx_tuple__577);
  __pyx_codeobj__578 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__577, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_float32_float32, 4271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__578)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4372
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float32_float64(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__579 = 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__579)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__579);
  __Pyx_GIVEREF(__pyx_tuple__579);
  __pyx_codeobj__580 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__579, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_float32_float64, 4372, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__580)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4473
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float64_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__581 = 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__581)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__581);
  __Pyx_GIVEREF(__pyx_tuple__581);
  __pyx_codeobj__582 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__581, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_float64_float64, 4473, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__582)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4574
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_object_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */
  __pyx_tuple__583 = 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__583)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__583);
  __Pyx_GIVEREF(__pyx_tuple__583);
  __pyx_codeobj__584 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__583, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_object_object, 4574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__584)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4656
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_bool_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 */
  __pyx_tuple__585 = 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__585)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__585);
  __Pyx_GIVEREF(__pyx_tuple__585);
  __pyx_codeobj__586 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__585, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_bool_bool, 4656, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__586)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4718
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_bool_object(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */
  __pyx_tuple__587 = 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__587)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__587);
  __Pyx_GIVEREF(__pyx_tuple__587);
  __pyx_codeobj__588 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__587, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_bool_object, 4718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__588)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4780
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int8(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 */
  __pyx_tuple__589 = 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__589)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__589);
  __Pyx_GIVEREF(__pyx_tuple__589);
  __pyx_codeobj__590 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__589, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int8_int8, 4780, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__590)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4842
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int32(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_tuple__591 = 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__591)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__591);
  __Pyx_GIVEREF(__pyx_tuple__591);
  __pyx_codeobj__592 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__591, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int8_int32, 4842, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__592)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4904
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_tuple__593 = 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__593)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__593);
  __Pyx_GIVEREF(__pyx_tuple__593);
  __pyx_codeobj__594 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__593, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int8_int64, 4904, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__594)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":4966
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_float64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__595 = 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__595)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__595);
  __Pyx_GIVEREF(__pyx_tuple__595);
  __pyx_codeobj__596 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__595, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int8_float64, 4966, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__596)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5028
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int16(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 */
  __pyx_tuple__597 = 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__597)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__597);
  __Pyx_GIVEREF(__pyx_tuple__597);
  __pyx_codeobj__598 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__597, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int16_int16, 5028, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__598)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5090
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int32(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_tuple__599 = 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__599)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__599);
  __Pyx_GIVEREF(__pyx_tuple__599);
  __pyx_codeobj__600 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__599, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int16_int32, 5090, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__600)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5152
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_tuple__601 = 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__601)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__601);
  __Pyx_GIVEREF(__pyx_tuple__601);
  __pyx_codeobj__602 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__601, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int16_int64, 5152, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__602)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5214
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_float64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__603 = 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__603)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__603);
  __Pyx_GIVEREF(__pyx_tuple__603);
  __pyx_codeobj__604 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__603, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int16_float64, 5214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__604)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5276
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_tuple__605 = 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__605)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__605);
  __Pyx_GIVEREF(__pyx_tuple__605);
  __pyx_codeobj__606 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__605, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int32_int32, 5276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__606)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5338
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_int64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_tuple__607 = 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__607)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__607);
  __Pyx_GIVEREF(__pyx_tuple__607);
  __pyx_codeobj__608 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__607, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int32_int64, 5338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__608)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5400
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_float64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__609 = 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__609)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__609);
  __Pyx_GIVEREF(__pyx_tuple__609);
  __pyx_codeobj__610 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__609, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int32_float64, 5400, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__610)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5462
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int64_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_tuple__611 = 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__611)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__611);
  __Pyx_GIVEREF(__pyx_tuple__611);
  __pyx_codeobj__612 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__611, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int64_int64, 5462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__612)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5524
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int64_float64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__613 = 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__613)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__613);
  __Pyx_GIVEREF(__pyx_tuple__613);
  __pyx_codeobj__614 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__613, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int64_float64, 5524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__614)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5586
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float32_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 */
  __pyx_tuple__615 = 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__615)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__615);
  __Pyx_GIVEREF(__pyx_tuple__615);
  __pyx_codeobj__616 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__615, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_float32_float32, 5586, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__616)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5648
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float32_float64(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__617 = 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__617)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__617);
  __Pyx_GIVEREF(__pyx_tuple__617);
  __pyx_codeobj__618 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__617, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_float32_float64, 5648, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__618)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5710
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float64_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_tuple__619 = 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__619)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__619);
  __Pyx_GIVEREF(__pyx_tuple__619);
  __pyx_codeobj__620 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__619, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_float64_float64, 5710, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__620)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5772
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_object_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */
  __pyx_tuple__621 = 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__621)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__621);
  __Pyx_GIVEREF(__pyx_tuple__621);
  __pyx_codeobj__622 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__621, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_object_object, 5772, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__622)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5808
 * @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__623 = 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__623)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__623);
  __Pyx_GIVEREF(__pyx_tuple__623);
  __pyx_codeobj__624 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__623, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_bool_bool, 5808, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__624)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5836
 * @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__625 = 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__625)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__625);
  __Pyx_GIVEREF(__pyx_tuple__625);
  __pyx_codeobj__626 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__625, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_bool_object, 5836, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__626)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5864
 * @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__627 = 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__627)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__627);
  __Pyx_GIVEREF(__pyx_tuple__627);
  __pyx_codeobj__628 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__627, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int8_int8, 5864, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__628)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5892
 * @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__629 = 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__629)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__629);
  __Pyx_GIVEREF(__pyx_tuple__629);
  __pyx_codeobj__630 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__629, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int8_int32, 5892, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__630)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5920
 * @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__631 = 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__631)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__631);
  __Pyx_GIVEREF(__pyx_tuple__631);
  __pyx_codeobj__632 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__631, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int8_int64, 5920, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__632)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5948
 * @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__633 = 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__633)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__633);
  __Pyx_GIVEREF(__pyx_tuple__633);
  __pyx_codeobj__634 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__633, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int8_float64, 5948, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__634)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":5976
 * @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__635 = 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__635)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__635);
  __Pyx_GIVEREF(__pyx_tuple__635);
  __pyx_codeobj__636 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__635, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int16_int16, 5976, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__636)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6004
 * @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__637 = 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__637)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__637);
  __Pyx_GIVEREF(__pyx_tuple__637);
  __pyx_codeobj__638 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__637, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int16_int32, 6004, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__638)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6032
 * @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__639 = 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__639)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__639);
  __Pyx_GIVEREF(__pyx_tuple__639);
  __pyx_codeobj__640 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__639, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int16_int64, 6032, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__640)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6060
 * @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__641 = 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__641)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__641);
  __Pyx_GIVEREF(__pyx_tuple__641);
  __pyx_codeobj__642 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__641, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int16_float64, 6060, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__642)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6088
 * @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__643 = 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__643)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__643);
  __Pyx_GIVEREF(__pyx_tuple__643);
  __pyx_codeobj__644 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__643, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int32_int32, 6088, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__644)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6116
 * @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__645 = 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__645)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__645);
  __Pyx_GIVEREF(__pyx_tuple__645);
  __pyx_codeobj__646 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__645, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int32_int64, 6116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__646)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6144
 * @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__647 = 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__647)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__647);
  __Pyx_GIVEREF(__pyx_tuple__647);
  __pyx_codeobj__648 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__647, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int32_float64, 6144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__648)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6172
 * @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__649 = 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__649)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__649);
  __Pyx_GIVEREF(__pyx_tuple__649);
  __pyx_codeobj__650 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__649, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int64_int64, 6172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__650)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6200
 * @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__651 = 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__651)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__651);
  __Pyx_GIVEREF(__pyx_tuple__651);
  __pyx_codeobj__652 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__651, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int64_float64, 6200, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__652)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6228
 * @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__653 = 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__653)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__653);
  __Pyx_GIVEREF(__pyx_tuple__653);
  __pyx_codeobj__654 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__653, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_float32_float32, 6228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__654)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6256
 * @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__655 = 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__655)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__655);
  __Pyx_GIVEREF(__pyx_tuple__655);
  __pyx_codeobj__656 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__655, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_float32_float64, 6256, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__656)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6284
 * @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__657 = 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__657)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__657);
  __Pyx_GIVEREF(__pyx_tuple__657);
  __pyx_codeobj__658 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__657, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_float64_float64, 6284, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__658)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6312
 * @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__659 = 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__659)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__659);
  __Pyx_GIVEREF(__pyx_tuple__659);
  __pyx_codeobj__660 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__659, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_object_object, 6312, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__660)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6341
 * @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__661 = 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__661)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__661);
  __Pyx_GIVEREF(__pyx_tuple__661);
  __pyx_codeobj__662 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__661, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_float64, 6341, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__662)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6384
 * @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__663 = 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__663)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__663);
  __Pyx_GIVEREF(__pyx_tuple__663);
  __pyx_codeobj__664 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__663, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_float32, 6384, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__664)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6427
 * @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__665 = 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__665)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__665);
  __Pyx_GIVEREF(__pyx_tuple__665);
  __pyx_codeobj__666 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__665, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_int8, 6427, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__666)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6470
 * @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__667 = 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__667)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__667);
  __Pyx_GIVEREF(__pyx_tuple__667);
  __pyx_codeobj__668 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__667, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_int16, 6470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__668)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6513
 * @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__669 = 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__669)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__669);
  __Pyx_GIVEREF(__pyx_tuple__669);
  __pyx_codeobj__670 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__669, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_int32, 6513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__670)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6556
 * @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__671 = 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__671)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__671);
  __Pyx_GIVEREF(__pyx_tuple__671);
  __pyx_codeobj__672 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__671, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_int64, 6556, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__672)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6600
 * @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__673 = 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__673)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__673);
  __Pyx_GIVEREF(__pyx_tuple__673);
  __pyx_codeobj__674 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__673, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_add_float64, 6600, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__674)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6656
 * @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__675 = 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__675)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__675);
  __Pyx_GIVEREF(__pyx_tuple__675);
  __pyx_codeobj__676 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__675, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_add_float32, 6656, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__676)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6713
 * @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__677 = 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__677)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__677);
  __Pyx_GIVEREF(__pyx_tuple__677);
  __pyx_codeobj__678 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__677, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_add_bin_float64, 6713, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__678)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6769
 * @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__679 = 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__679)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__679);
  __Pyx_GIVEREF(__pyx_tuple__679);
  __pyx_codeobj__680 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__679, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_add_bin_float32, 6769, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__680)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6826
 * @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__681 = 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__681)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__681);
  __Pyx_GIVEREF(__pyx_tuple__681);
  __pyx_codeobj__682 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__681, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_prod_float64, 6826, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__682)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6882
 * @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__683 = 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__683)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__683);
  __Pyx_GIVEREF(__pyx_tuple__683);
  __pyx_codeobj__684 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__683, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_prod_float32, 6882, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__684)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6939
 * @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__685 = 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__685)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__685);
  __Pyx_GIVEREF(__pyx_tuple__685);
  __pyx_codeobj__686 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__685, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_prod_bin_float64, 6939, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__686)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":6995
 * @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__687 = 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__687)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__687);
  __Pyx_GIVEREF(__pyx_tuple__687);
  __pyx_codeobj__688 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__687, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_prod_bin_float32, 6995, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__688)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7052
 * @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__689 = 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__689)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__689);
  __Pyx_GIVEREF(__pyx_tuple__689);
  __pyx_codeobj__690 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__689, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_var_float64, 7052, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__690)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7113
 * @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__691 = 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__691)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__691);
  __Pyx_GIVEREF(__pyx_tuple__691);
  __pyx_codeobj__692 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__691, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_var_float32, 7113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__692)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7175
 * @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__693 = 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__693)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__693);
  __Pyx_GIVEREF(__pyx_tuple__693);
  __pyx_codeobj__694 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__693, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_var_bin_float64, 7175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__694)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7236
 * @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__695 = 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__695)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__695);
  __Pyx_GIVEREF(__pyx_tuple__695);
  __pyx_codeobj__696 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__695, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_var_bin_float32, 7236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__696)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7298
 * @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__697 = 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__697)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__697);
  __Pyx_GIVEREF(__pyx_tuple__697);
  __pyx_codeobj__698 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__697, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_mean_float64, 7298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__698)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7350
 * @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__699 = 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__699)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__699);
  __Pyx_GIVEREF(__pyx_tuple__699);
  __pyx_codeobj__700 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__699, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_mean_float32, 7350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__700)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7402
 * 
 * 
 * def group_mean_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */
  __pyx_tuple__701 = 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__701)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__701);
  __Pyx_GIVEREF(__pyx_tuple__701);
  __pyx_codeobj__702 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__701, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_mean_bin_float64, 7402, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__702)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7455
 *                 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__703 = 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__703)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__703);
  __Pyx_GIVEREF(__pyx_tuple__703);
  __pyx_codeobj__704 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__703, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_mean_bin_float32, 7455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__704)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7510
 * @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__705 = 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__705)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__705);
  __Pyx_GIVEREF(__pyx_tuple__705);
  __pyx_codeobj__706 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__705, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_ohlc_float64, 7510, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__706)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7584
 * @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__707 = 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__707)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__707);
  __Pyx_GIVEREF(__pyx_tuple__707);
  __pyx_codeobj__708 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__707, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_ohlc_float32, 7584, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__708)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7659
 * @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__709 = 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__709)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__709);
  __Pyx_GIVEREF(__pyx_tuple__709);
  __pyx_codeobj__710 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__709, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_float64, 7659, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__710)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7702
 * @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__711 = 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__711)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__711);
  __Pyx_GIVEREF(__pyx_tuple__711);
  __pyx_codeobj__712 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__711, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_float32, 7702, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__712)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7745
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[int64_t, ndim=2] values,
 */
  __pyx_tuple__713 = 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__713)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__713);
  __Pyx_GIVEREF(__pyx_tuple__713);
  __pyx_codeobj__714 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__713, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_int64, 7745, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__714)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7789
 * @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__715 = 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__715)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__715);
  __Pyx_GIVEREF(__pyx_tuple__715);
  __pyx_codeobj__716 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__715, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_bin_float64, 7789, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__716)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7833
 * @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__717 = 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__717)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__717);
  __Pyx_GIVEREF(__pyx_tuple__717);
  __pyx_codeobj__718 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__717, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_bin_float32, 7833, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__718)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7877
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[int64_t, ndim=2] values,
 */
  __pyx_tuple__719 = 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__719)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__719);
  __Pyx_GIVEREF(__pyx_tuple__719);
  __pyx_codeobj__720 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__719, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_bin_int64, 7877, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__720)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7922
 * @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__721 = 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__721)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__721);
  __Pyx_GIVEREF(__pyx_tuple__721);
  __pyx_codeobj__722 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__721, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_float64, 7922, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__722)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":7966
 * @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__723 = 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__723)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__723);
  __Pyx_GIVEREF(__pyx_tuple__723);
  __pyx_codeobj__724 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__723, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_float32, 7966, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__724)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8010
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[int64_t, ndim=2] values,
 */
  __pyx_tuple__725 = 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__725)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__725);
  __Pyx_GIVEREF(__pyx_tuple__725);
  __pyx_codeobj__726 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__725, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_int64, 8010, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__726)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8055
 * @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__727 = 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__727)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__727);
  __Pyx_GIVEREF(__pyx_tuple__727);
  __pyx_codeobj__728 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__727, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_bin_float64, 8055, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__728)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8100
 * @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__729 = 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__729)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__729);
  __Pyx_GIVEREF(__pyx_tuple__729);
  __pyx_codeobj__730 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__729, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_bin_float32, 8100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__730)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8145
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[int64_t, ndim=2] values,
 */
  __pyx_tuple__731 = 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__731)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__731);
  __Pyx_GIVEREF(__pyx_tuple__731);
  __pyx_codeobj__732 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__731, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_bin_int64, 8145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__732)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8191
 * @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__733 = 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__733)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__733);
  __Pyx_GIVEREF(__pyx_tuple__733);
  __pyx_codeobj__734 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__733, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_float64, 8191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__734)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8251
 * @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__735 = 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__735)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__735);
  __Pyx_GIVEREF(__pyx_tuple__735);
  __pyx_codeobj__736 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__735, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_float32, 8251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__736)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8311
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[int64_t, ndim=2] values,
 */
  __pyx_tuple__737 = 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__737)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__737);
  __Pyx_GIVEREF(__pyx_tuple__737);
  __pyx_codeobj__738 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__737, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_int64, 8311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__738)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8372
 * @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__739 = 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__739)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__739);
  __Pyx_GIVEREF(__pyx_tuple__739);
  __pyx_codeobj__740 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__739, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_bin_float64, 8372, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__740)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8433
 * @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__741 = 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__741)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__741);
  __Pyx_GIVEREF(__pyx_tuple__741);
  __pyx_codeobj__742 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__741, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_bin_float32, 8433, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__742)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8494
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[int64_t, ndim=2] values,
 */
  __pyx_tuple__743 = 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__743)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__743);
  __Pyx_GIVEREF(__pyx_tuple__743);
  __pyx_codeobj__744 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__743, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_bin_int64, 8494, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__744)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8556
 * @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__745 = 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__745)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__745);
  __Pyx_GIVEREF(__pyx_tuple__745);
  __pyx_codeobj__746 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__745, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_float64, 8556, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__746)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8616
 * @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__747 = 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__747)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__747);
  __Pyx_GIVEREF(__pyx_tuple__747);
  __pyx_codeobj__748 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__747, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_float32, 8616, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__748)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8676
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[int64_t, ndim=2] values,
 */
  __pyx_tuple__749 = 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__749)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__749);
  __Pyx_GIVEREF(__pyx_tuple__749);
  __pyx_codeobj__750 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__749, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_int64, 8676, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__750)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8737
 * @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__751 = 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__751)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__751);
  __Pyx_GIVEREF(__pyx_tuple__751);
  __pyx_codeobj__752 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__751, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_bin_float64, 8737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__752)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8797
 * @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__753 = 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__753)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__753);
  __Pyx_GIVEREF(__pyx_tuple__753);
  __pyx_codeobj__754 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__753, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_bin_float32, 8797, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__754)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8857
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[int64_t, ndim=2] values,
 */
  __pyx_tuple__755 = 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__755)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__755);
  __Pyx_GIVEREF(__pyx_tuple__755);
  __pyx_codeobj__756 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__755, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_bin_int64, 8857, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__756)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8918
 * @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__757 = 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__757)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__757);
  __Pyx_GIVEREF(__pyx_tuple__757);
  __pyx_codeobj__758 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__757, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_float64, 8918, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__758)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8954
 * @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__759 = 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__759)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__759);
  __Pyx_GIVEREF(__pyx_tuple__759);
  __pyx_codeobj__760 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__759, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_float32, 8954, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__760)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":8990
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[int64_t, ndim=2] values,
 */
  __pyx_tuple__761 = 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__761)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__761);
  __Pyx_GIVEREF(__pyx_tuple__761);
  __pyx_codeobj__762 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__761, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_int64, 8990, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__762)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":9026
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[object, ndim=2] values,
 */
  __pyx_tuple__763 = 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__763)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__763);
  __Pyx_GIVEREF(__pyx_tuple__763);
  __pyx_codeobj__764 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__763, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_object, 9026, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__764)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":9062
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[int64_t, ndim=2] values,
 */
  __pyx_tuple__765 = 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__765)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__765);
  __Pyx_GIVEREF(__pyx_tuple__765);
  __pyx_codeobj__766 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__765, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_int64, 9062, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__766)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":9099
 * @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__767 = 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__767)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__767);
  __Pyx_GIVEREF(__pyx_tuple__767);
  __pyx_codeobj__768 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__767, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_bin_float64, 9099, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__768)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":9133
 * @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__769 = 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__769)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__769);
  __Pyx_GIVEREF(__pyx_tuple__769);
  __pyx_codeobj__770 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__769, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_bin_float32, 9133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__770)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":9167
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[int64_t, ndim=2] values,
 */
  __pyx_tuple__771 = 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__771)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__771);
  __Pyx_GIVEREF(__pyx_tuple__771);
  __pyx_codeobj__772 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__771, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_bin_int64, 9167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__772)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":9201
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[object, ndim=2] values,
 */
  __pyx_tuple__773 = 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__773)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__773);
  __Pyx_GIVEREF(__pyx_tuple__773);
  __pyx_codeobj__774 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__773, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_bin_object, 9201, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__774)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":9235
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[int64_t, ndim=2] values,
 */
  __pyx_tuple__775 = 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__775)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__775);
  __Pyx_GIVEREF(__pyx_tuple__775);
  __pyx_codeobj__776 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__775, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_bin_int64, 9235, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__776)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":9270
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[float64_t] right):
 *     cdef:
 */
  __pyx_tuple__777 = 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__777)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__777);
  __Pyx_GIVEREF(__pyx_tuple__777);
  __pyx_codeobj__778 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__777, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_float64, 9270, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__778)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":9315
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[float32_t] right):
 *     cdef:
 */
  __pyx_tuple__779 = 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__779)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__779);
  __Pyx_GIVEREF(__pyx_tuple__779);
  __pyx_codeobj__780 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__779, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_float32, 9315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__780)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":9360
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[object] right):
 *     cdef:
 */
  __pyx_tuple__781 = 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__781)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__781);
  __Pyx_GIVEREF(__pyx_tuple__781);
  __pyx_codeobj__782 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__781, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_object, 9360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__782)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":9405
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[int32_t] right):
 *     cdef:
 */
  __pyx_tuple__783 = 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__783)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__783);
  __Pyx_GIVEREF(__pyx_tuple__783);
  __pyx_codeobj__784 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__783, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_int32, 9405, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__784)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":9450
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[int64_t] right):
 *     cdef:
 */
  __pyx_tuple__785 = 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__785)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__785);
  __Pyx_GIVEREF(__pyx_tuple__785);
  __pyx_codeobj__786 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__785, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_int64, 9450, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__786)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":9495
 * 
 * 
 * def left_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float64_t] right):
 *     '''
 */
  __pyx_tuple__787 = 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__787)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__787);
  __Pyx_GIVEREF(__pyx_tuple__787);
  __pyx_codeobj__788 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__787, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_float64, 9495, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__788)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":9597
 * 
 * 
 * def left_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float32_t] right):
 *     '''
 */
  __pyx_tuple__789 = 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__789)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__789);
  __Pyx_GIVEREF(__pyx_tuple__789);
  __pyx_codeobj__790 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__789, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_float32, 9597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__790)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":9699
 * 
 * 
 * def left_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                               ndarray[object] right):
 *     '''
 */
  __pyx_tuple__791 = 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__791)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__791);
  __Pyx_GIVEREF(__pyx_tuple__791);
  __pyx_codeobj__792 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__791, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_object, 9699, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__792)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":9801
 * 
 * 
 * def left_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int32_t] right):
 *     '''
 */
  __pyx_tuple__793 = 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__793)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__793);
  __Pyx_GIVEREF(__pyx_tuple__793);
  __pyx_codeobj__794 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__793, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_int32, 9801, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__794)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":9903
 * 
 * 
 * def left_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] right):
 *     '''
 */
  __pyx_tuple__795 = 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__795)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__795);
  __Pyx_GIVEREF(__pyx_tuple__795);
  __pyx_codeobj__796 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__795, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_int64, 9903, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__796)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":10007
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[float64_t] right):
 *     cdef:
 */
  __pyx_tuple__797 = 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__797)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__797);
  __Pyx_GIVEREF(__pyx_tuple__797);
  __pyx_codeobj__798 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__797, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_float64, 10007, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__798)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":10136
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[float32_t] right):
 *     cdef:
 */
  __pyx_tuple__799 = 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__799)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__799);
  __Pyx_GIVEREF(__pyx_tuple__799);
  __pyx_codeobj__800 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__799, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_float32, 10136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__800)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":10265
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[object] right):
 *     cdef:
 */
  __pyx_tuple__801 = 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__801)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__801);
  __Pyx_GIVEREF(__pyx_tuple__801);
  __pyx_codeobj__802 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__801, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_object, 10265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__802)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":10394
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[int32_t] right):
 *     cdef:
 */
  __pyx_tuple__803 = 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__803)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__803);
  __Pyx_GIVEREF(__pyx_tuple__803);
  __pyx_codeobj__804 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__803, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_int32, 10394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__804)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":10523
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[int64_t] right):
 *     cdef:
 */
  __pyx_tuple__805 = 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__805)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__805);
  __Pyx_GIVEREF(__pyx_tuple__805);
  __pyx_codeobj__806 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__805, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_int64, 10523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__806)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":10653
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float64_t] right):
 *     '''
 */
  __pyx_tuple__807 = 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__807)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__807);
  __Pyx_GIVEREF(__pyx_tuple__807);
  __pyx_codeobj__808 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__807, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_float64, 10653, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__808)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":10746
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float32_t] right):
 *     '''
 */
  __pyx_tuple__809 = 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__809)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__809);
  __Pyx_GIVEREF(__pyx_tuple__809);
  __pyx_codeobj__810 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__809, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_float32, 10746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__810)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":10839
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                               ndarray[object] right):
 *     '''
 */
  __pyx_tuple__811 = 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__811)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__811);
  __Pyx_GIVEREF(__pyx_tuple__811);
  __pyx_codeobj__812 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__811, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_object, 10839, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__812)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":10932
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int32_t] right):
 *     '''
 */
  __pyx_tuple__813 = 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__813)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__813);
  __Pyx_GIVEREF(__pyx_tuple__813);
  __pyx_codeobj__814 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__813, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_int32, 10932, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__814)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/generated.pyx":11025
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] right):
 *     '''
 */
  __pyx_tuple__815 = 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__815)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__815);
  __Pyx_GIVEREF(__pyx_tuple__815);
  __pyx_codeobj__816 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__815, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_int64, 11025, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__816)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11025; __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__817 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__817)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__817);
  __Pyx_GIVEREF(__pyx_tuple__817);

  /* "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__818 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__818)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__818);
  __Pyx_GIVEREF(__pyx_tuple__818);

  /* "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__819 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__819)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__819);
  __Pyx_GIVEREF(__pyx_tuple__819);

  /* "View.MemoryView":281
 * 
 * 
 * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
 * 
 */
  __pyx_tuple__820 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__820)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__820);
  __Pyx_GIVEREF(__pyx_tuple__820);

  /* "View.MemoryView":282
 * 
 * cdef contiguous = Enum("<contiguous and direct>")
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__821 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__821)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__821);
  __Pyx_GIVEREF(__pyx_tuple__821);
  __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_float_0_ = PyFloat_FromDouble(0.); if (unlikely(!__pyx_float_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_9223372036854775807 = PyInt_FromString((char *)"9223372036854775807", 0, 0); if (unlikely(!__pyx_int_9223372036854775807)) {__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;}
  __pyx_int_neg_9223372036854775807 = PyInt_FromString((char *)"-9223372036854775807", 0, 0); if (unlikely(!__pyx_int_neg_9223372036854775807)) {__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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_5numpy_int8_t __pyx_t_7;
  __pyx_t_5numpy_int16_t __pyx_t_8;
  __pyx_t_5numpy_int32_t __pyx_t_9;
  __pyx_t_5numpy_int64_t __pyx_t_10;
  __pyx_t_5numpy_float16_t __pyx_t_11;
  __pyx_t_5numpy_float32_t __pyx_t_12;
  __pyx_t_5numpy_float64_t __pyx_t_13;
  double __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  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("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_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 (PyObject_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 (PyObject_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 (PyObject_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 (PyObject_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 = 921; __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 = 921; __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 ---*/
  __pyx_t_1 = __Pyx_ImportModule("pandas.lib"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_1, "is_null_datetimelike", (void (**)(void))&__pyx_f_6pandas_3lib_is_null_datetimelike, "int (PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*--- Execution code ---*/

  /* "pandas/algos.pyx":3
 * from numpy cimport *
 * cimport numpy as np
 * import numpy as np             # <<<<<<<<<<<<<<
 * 
 * cimport cython
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __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[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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             # <<<<<<<<<<<<<<
 * 
 * cimport util
 */
  __pyx_v_6pandas_5algos_FP_ERR = 1e-13;

  /* "pandas/algos.pyx":26
 *                     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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __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 = 26; __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 = 26; __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(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int8, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":27
 * 
 * int8 = np.dtype(np.int8)
 * int16 = np.dtype(np.int16)             # <<<<<<<<<<<<<<
 * int32 = np.dtype(np.int32)
 * int64 = np.dtype(np.int64)
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int16); 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_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __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*)__pyx_ptype_5numpy_dtype)), __pyx_t_3, 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_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int16, __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)
 * float16 = np.dtype(np.float16)
 */
  __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_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __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 = 28; __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(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int32, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":29
 * 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); 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_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __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*)__pyx_ptype_5numpy_dtype)), __pyx_t_3, 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_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int64, __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
 * 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_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_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __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 = 30; __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(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_float16, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":31
 * int64 = np.dtype(np.int64)
 * float16 = np.dtype(np.float16)
 * float32 = np.dtype(np.float32)             # <<<<<<<<<<<<<<
 * float64 = np.dtype(np.float64)
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); 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_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __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*)__pyx_ptype_5numpy_dtype)), __pyx_t_3, 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_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_float32, __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
 * 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_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_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __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 = 32; __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(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_float64, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":34
 * 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 = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __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_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __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 = NULL;
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_min); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_4); if (unlikely((__pyx_t_7 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_6pandas_5algos_MINint8 = __pyx_t_7;

  /* "pandas/algos.pyx":35
 * 
 * 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int16); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_2 = PyTuple_New(1+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 = NULL;
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __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_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_min); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_npy_int16(__pyx_t_6); if (unlikely((__pyx_t_8 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_6pandas_5algos_MINint16 = __pyx_t_8;

  /* "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
 * cdef np.float16_t MINfloat16 = np.NINF
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_iinfo); 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_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); 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);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __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_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __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_6); __pyx_t_6 = 0;
  __pyx_t_9 = __Pyx_PyInt_As_npy_int32(__pyx_t_2); if (unlikely((__pyx_t_9 == (npy_int32)-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_MINint32 = __pyx_t_9;

  /* "pandas/algos.pyx":37
 * 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_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_iinfo); 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_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __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 = NULL;
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); 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_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_min); 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_10 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_10 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_6pandas_5algos_MINint64 = __pyx_t_10;

  /* "pandas/algos.pyx":38
 * 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NINF); 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_3); __pyx_t_3 = 0;
  __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_11 == (npy_float16)-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_MINfloat16 = __pyx_t_11;

  /* "pandas/algos.pyx":39
 * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NINF); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_12 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_6pandas_5algos_MINfloat32 = __pyx_t_12;

  /* "pandas/algos.pyx":40
 * 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __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_3); __pyx_t_3 = 0;
  __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_13 == (npy_float64)-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_MINfloat64 = __pyx_t_13;

  /* "pandas/algos.pyx":42
 * 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __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_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_npy_int8(__pyx_t_4); if (unlikely((__pyx_t_7 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_6pandas_5algos_MAXint8 = __pyx_t_7;

  /* "pandas/algos.pyx":43
 * 
 * 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __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 = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); 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);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __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_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_max); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_npy_int16(__pyx_t_6); if (unlikely((__pyx_t_8 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_6pandas_5algos_MAXint16 = __pyx_t_8;

  /* "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
 * cdef np.float16_t MAXfloat16 = np.inf
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __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_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); 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);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __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_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_max); 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_6); __pyx_t_6 = 0;
  __pyx_t_9 = __Pyx_PyInt_As_npy_int32(__pyx_t_3); if (unlikely((__pyx_t_9 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_6pandas_5algos_MAXint32 = __pyx_t_9;

  /* "pandas/algos.pyx":45
 * 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_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __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_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __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 = NULL;
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 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 = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_max); 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_3); __pyx_t_3 = 0;
  __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_10 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_6pandas_5algos_MAXint64 = __pyx_t_10;

  /* "pandas/algos.pyx":46
 * 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); 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_2); __pyx_t_2 = 0;
  __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_11 == (npy_float16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_6pandas_5algos_MAXfloat16 = __pyx_t_11;

  /* "pandas/algos.pyx":47
 * 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __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_3); __pyx_t_3 = 0;
  __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_12 == (npy_float32)-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_MAXfloat32 = __pyx_t_12;

  /* "pandas/algos.pyx":48
 * 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_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_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_13 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_6pandas_5algos_MAXfloat64 = __pyx_t_13;

  /* "pandas/algos.pyx":50
 * cdef np.float64_t MAXfloat64 = np.inf
 * 
 * cdef double NaN = <double> np.NaN             # <<<<<<<<<<<<<<
 * cdef double nan = NaN
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NaN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_6pandas_5algos_NaN = ((double)__pyx_t_14);

  /* "pandas/algos.pyx":51
 * 
 * cdef double NaN = <double> np.NaN
 * cdef double nan = NaN             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_6pandas_5algos_nan = __pyx_v_6pandas_5algos_NaN;

  /* "pandas/algos.pyx":63
 *     int signbit(double)
 * 
 * from pandas import lib             # <<<<<<<<<<<<<<
 * 
 * include "skiplist.pyx"
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_lib);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_lib);
  __Pyx_GIVEREF(__pyx_n_s_lib);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pandas, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/src/skiplist.pyx":23
 * cimport numpy as np
 * from numpy cimport *
 * import numpy as np             # <<<<<<<<<<<<<<
 * 
 * from random import random
 */
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/src/skiplist.pyx":25
 * import numpy as np
 * 
 * from random import random             # <<<<<<<<<<<<<<
 * 
 * # initialize numpy
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_random);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_random);
  __Pyx_GIVEREF(__pyx_n_s_random);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_random, __pyx_t_3, -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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_random, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); 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_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(0); 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_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __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_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5algos_Node)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NIL, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/algos.pyx":69
 * 
 * cdef:
 *     int TIEBREAK_AVERAGE = 0             # <<<<<<<<<<<<<<
 *     int TIEBREAK_MIN = 1
 *     int TIEBREAK_MAX = 2
 */
  __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE = 0;

  /* "pandas/algos.pyx":70
 * 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":71
 *     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":72
 *     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":73
 *     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":74
 *     int TIEBREAK_FIRST = 3
 *     int TIEBREAK_FIRST_DESCENDING = 4
 *     int TIEBREAK_DENSE = 5             # <<<<<<<<<<<<<<
 * 
 * tiebreakers = {
 */
  __pyx_v_6pandas_5algos_TIEBREAK_DENSE = 5;

  /* "pandas/algos.pyx":76
 *     int TIEBREAK_DENSE = 5
 * 
 * tiebreakers = {             # <<<<<<<<<<<<<<
 *     'average' : TIEBREAK_AVERAGE,
 *     'min' : TIEBREAK_MIN,
 */
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "pandas/algos.pyx":77
 * 
 * tiebreakers = {
 *     'average' : TIEBREAK_AVERAGE,             # <<<<<<<<<<<<<<
 *     'min' : TIEBREAK_MIN,
 *     'max' : TIEBREAK_MAX,
 */
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_AVERAGE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_average, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/algos.pyx":78
 * tiebreakers = {
 *     'average' : TIEBREAK_AVERAGE,
 *     'min' : TIEBREAK_MIN,             # <<<<<<<<<<<<<<
 *     'max' : TIEBREAK_MAX,
 *     'first' : TIEBREAK_FIRST,
 */
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_MIN); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_min, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/algos.pyx":79
 *     'average' : TIEBREAK_AVERAGE,
 *     'min' : TIEBREAK_MIN,
 *     'max' : TIEBREAK_MAX,             # <<<<<<<<<<<<<<
 *     'first' : TIEBREAK_FIRST,
 *     'dense' : TIEBREAK_DENSE,
 */
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_MAX); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_max, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/algos.pyx":80
 *     'min' : TIEBREAK_MIN,
 *     'max' : TIEBREAK_MAX,
 *     'first' : TIEBREAK_FIRST,             # <<<<<<<<<<<<<<
 *     'dense' : TIEBREAK_DENSE,
 * }
 */
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_FIRST); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_first, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/algos.pyx":81
 *     'max' : TIEBREAK_MAX,
 *     'first' : TIEBREAK_FIRST,
 *     'dense' : TIEBREAK_DENSE,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_DENSE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dense, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tiebreakers, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/algos.pyx":138
 * 
 * 
 * def rank_1d_float64(object in_arr, ties_method='average', ascending=True,             # <<<<<<<<<<<<<<
 *                     na_option='keep', pct=False):
 *     """
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_1rank_1d_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_1d_float64, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/algos.pyx":219
 * 
 * 
 * def rank_1d_int64(object in_arr, ties_method='average', ascending=True,             # <<<<<<<<<<<<<<
 *                   na_option='keep', pct=False):
 *     """
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_3rank_1d_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_1d_int64, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/algos.pyx":288
 * 
 * 
 * def rank_2d_float64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_5rank_2d_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_2d_float64, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/algos.pyx":380
 * 
 * 
 * def rank_2d_int64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_7rank_2d_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_2d_int64, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/algos.pyx":457
 * 
 * 
 * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_9rank_1d_generic, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_1d_generic, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/algos.pyx":552
 *         return left != right
 * 
 * _return_false = lambda self, other: False             # <<<<<<<<<<<<<<
 * _return_true = lambda self, other: True
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5algos_532lambda1, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_pandas_algos, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_return_false, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/algos.pyx":553
 * 
 * _return_false = lambda self, other: False
 * _return_true = lambda self, other: True             # <<<<<<<<<<<<<<
 * 
 * class Infinity(object):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5algos_533lambda2, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_pandas_algos, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_return_true, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/algos.pyx":555
 * _return_true = lambda self, other: True
 * 
 * class Infinity(object):             # <<<<<<<<<<<<<<
 * 
 *     __lt__ = _return_false
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_n_s_Infinity, __pyx_n_s_Infinity, (PyObject *) NULL, __pyx_n_s_pandas_algos, (PyObject *) NULL); 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);

  /* "pandas/algos.pyx":557
 * class Infinity(object):
 * 
 *     __lt__ = _return_false             # <<<<<<<<<<<<<<
 *     __le__ = _return_false
 *     __eq__ = _return_false
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_lt, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":558
 * 
 *     __lt__ = _return_false
 *     __le__ = _return_false             # <<<<<<<<<<<<<<
 *     __eq__ = _return_false
 *     __ne__ = _return_true
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_le, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":559
 *     __lt__ = _return_false
 *     __le__ = _return_false
 *     __eq__ = _return_false             # <<<<<<<<<<<<<<
 *     __ne__ = _return_true
 *     __gt__ = _return_true
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_eq, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":560
 *     __le__ = _return_false
 *     __eq__ = _return_false
 *     __ne__ = _return_true             # <<<<<<<<<<<<<<
 *     __gt__ = _return_true
 *     __ge__ = _return_true
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_ne, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":561
 *     __eq__ = _return_false
 *     __ne__ = _return_true
 *     __gt__ = _return_true             # <<<<<<<<<<<<<<
 *     __ge__ = _return_true
 *     __cmp__ = _return_false
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_gt, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":562
 *     __ne__ = _return_true
 *     __gt__ = _return_true
 *     __ge__ = _return_true             # <<<<<<<<<<<<<<
 *     __cmp__ = _return_false
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_ge, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":563
 *     __gt__ = _return_true
 *     __ge__ = _return_true
 *     __cmp__ = _return_false             # <<<<<<<<<<<<<<
 * 
 * class NegInfinity(object):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_cmp, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":555
 * _return_true = lambda self, other: True
 * 
 * class Infinity(object):             # <<<<<<<<<<<<<<
 * 
 *     __lt__ = _return_false
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_Infinity, __pyx_t_4, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Infinity, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/algos.pyx":565
 *     __cmp__ = _return_false
 * 
 * class NegInfinity(object):             # <<<<<<<<<<<<<<
 * 
 *     __lt__ = _return_true
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_n_s_NegInfinity, __pyx_n_s_NegInfinity, (PyObject *) NULL, __pyx_n_s_pandas_algos, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "pandas/algos.pyx":567
 * class NegInfinity(object):
 * 
 *     __lt__ = _return_true             # <<<<<<<<<<<<<<
 *     __le__ = _return_true
 *     __eq__ = _return_false
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_lt, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":568
 * 
 *     __lt__ = _return_true
 *     __le__ = _return_true             # <<<<<<<<<<<<<<
 *     __eq__ = _return_false
 *     __ne__ = _return_true
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); 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);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_le, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":569
 *     __lt__ = _return_true
 *     __le__ = _return_true
 *     __eq__ = _return_false             # <<<<<<<<<<<<<<
 *     __ne__ = _return_true
 *     __gt__ = _return_false
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_eq, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":570
 *     __le__ = _return_true
 *     __eq__ = _return_false
 *     __ne__ = _return_true             # <<<<<<<<<<<<<<
 *     __gt__ = _return_false
 *     __ge__ = _return_false
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_ne, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":571
 *     __eq__ = _return_false
 *     __ne__ = _return_true
 *     __gt__ = _return_false             # <<<<<<<<<<<<<<
 *     __ge__ = _return_false
 *     __cmp__ = _return_true
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_gt, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":572
 *     __ne__ = _return_true
 *     __gt__ = _return_false
 *     __ge__ = _return_false             # <<<<<<<<<<<<<<
 *     __cmp__ = _return_true
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_ge, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":573
 *     __gt__ = _return_false
 *     __ge__ = _return_false
 *     __cmp__ = _return_true             # <<<<<<<<<<<<<<
 * 
 * def rank_2d_generic(object in_arr, axis=0, ties_method='average',
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_cmp, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":565
 *     __cmp__ = _return_false
 * 
 * class NegInfinity(object):             # <<<<<<<<<<<<<<
 * 
 *     __lt__ = _return_true
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_NegInfinity, __pyx_t_4, __pyx_t_2, NULL, 0, 1); 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_NegInfinity, __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;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/algos.pyx":575
 *     __cmp__ = _return_true
 * 
 * def rank_2d_generic(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True, na_option='keep', pct=False):
 *     """
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_11rank_2d_generic, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_2d_generic, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/algos.pyx":702
 * # -
 * 
 * def _check_minp(win, minp, N, floor=1):             # <<<<<<<<<<<<<<
 *     if minp > win:
 *         raise ValueError('min_periods (%d) must be <= window (%d)'
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_13_check_minp, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_minp, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/algos.pyx":755
 * @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_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_6pandas_5algos_535__pyx_fuse_0kth_smallest, 0, __pyx_n_s_pyx_fuse_0kth_smallest, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_int8_t, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_6pandas_5algos_537__pyx_fuse_1kth_smallest, 0, __pyx_n_s_pyx_fuse_1kth_smallest, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_int16_t, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_6pandas_5algos_539__pyx_fuse_2kth_smallest, 0, __pyx_n_s_pyx_fuse_2kth_smallest, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_int32_t, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_6pandas_5algos_541__pyx_fuse_3kth_smallest, 0, __pyx_n_s_pyx_fuse_3kth_smallest, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_int64_t, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_6pandas_5algos_543__pyx_fuse_4kth_smallest, 0, __pyx_n_s_pyx_fuse_4kth_smallest, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_uint8_t, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_6pandas_5algos_545__pyx_fuse_5kth_smallest, 0, __pyx_n_s_pyx_fuse_5kth_smallest, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_uint16_t, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_6pandas_5algos_547__pyx_fuse_6kth_smallest, 0, __pyx_n_s_pyx_fuse_6kth_smallest, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_uint32_t, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_6pandas_5algos_549__pyx_fuse_7kth_smallest, 0, __pyx_n_s_pyx_fuse_7kth_smallest, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_uint64_t, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_8__pyx_mdef_6pandas_5algos_551__pyx_fuse_8kth_smallest, 0, __pyx_n_s_pyx_fuse_8kth_smallest, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_float32_t, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_fuse_9__pyx_mdef_6pandas_5algos_553__pyx_fuse_9kth_smallest, 0, __pyx_n_s_pyx_fuse_9kth_smallest, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_float64_t, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __pyx_FusedFunction_NewEx(&__pyx_mdef_6pandas_5algos_15kth_smallest, 0, __pyx_n_s_kth_smallest, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_empty_tuple);
  ((__pyx_FusedFunctionObject *) __pyx_t_5)->__signatures__ = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_kth_smallest, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/algos.pyx":808
 * 
 * 
 * cpdef numeric median(numeric[:] arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_6pandas_5algos_557__pyx_fuse_0median, 0, __pyx_n_s_pyx_fuse_0median, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__328)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int8_t, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_6pandas_5algos_559__pyx_fuse_1median, 0, __pyx_n_s_pyx_fuse_1median, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__328)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int16_t, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_6pandas_5algos_561__pyx_fuse_2median, 0, __pyx_n_s_pyx_fuse_2median, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__328)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int32_t, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_6pandas_5algos_563__pyx_fuse_3median, 0, __pyx_n_s_pyx_fuse_3median, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__328)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int64_t, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_6pandas_5algos_565__pyx_fuse_4median, 0, __pyx_n_s_pyx_fuse_4median, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__328)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint8_t, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_6pandas_5algos_567__pyx_fuse_5median, 0, __pyx_n_s_pyx_fuse_5median, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__328)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint16_t, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_6pandas_5algos_569__pyx_fuse_6median, 0, __pyx_n_s_pyx_fuse_6median, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__328)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint32_t, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_6pandas_5algos_571__pyx_fuse_7median, 0, __pyx_n_s_pyx_fuse_7median, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__328)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint64_t, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_8__pyx_mdef_6pandas_5algos_573__pyx_fuse_8median, 0, __pyx_n_s_pyx_fuse_8median, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__328)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_float32_t, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_9__pyx_mdef_6pandas_5algos_575__pyx_fuse_9median, 0, __pyx_n_s_pyx_fuse_9median, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__328)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_float64_t, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_mdef_6pandas_5algos_17median, 0, __pyx_n_s_median, NULL, __pyx_n_s_pandas_algos, __pyx_d, ((PyObject *)__pyx_codeobj__328)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
  ((__pyx_FusedFunctionObject *) __pyx_t_3)->__signatures__ = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_median, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/algos.pyx":828
 * # -------------- Min, Max subsequence
 * 
 * def max_subseq(ndarray[double_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i=0,s=0,e=0,T,n
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_19max_subseq, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_max_subseq, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":856
 *     return (s, e, m)
 * 
 * def min_subseq(ndarray[double_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t s, e
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_21min_subseq, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_min_subseq, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":868
 * # 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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_23roll_sum, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_sum, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":910
 * # Rolling mean
 * 
 * def roll_mean(ndarray[double_t] input,             # <<<<<<<<<<<<<<
 *                int win, int minp):
 *     cdef:
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_25roll_mean, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_mean, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":967
 * # Exponentially weighted moving average
 * 
 * def ewma(ndarray[double_t] input, double_t com, int adjust, int ignore_na, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     Compute exponentially-weighted moving average using center-of-mass.
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_27ewma, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ewma, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1028
 * # Exponentially weighted moving covariance
 * 
 * def ewmcov(ndarray[double_t] input_x, ndarray[double_t] input_y,             # <<<<<<<<<<<<<<
 *            double_t com, int adjust, int ignore_na, int minp, int bias):
 *     '''
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_29ewmcov, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ewmcov, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1125
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_31nancorr, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nancorr, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1184
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_33nancorr_spearman, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nancorr_spearman, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1245
 * # 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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_35roll_var, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_var, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1334
 * # 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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_37roll_skew, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_skew, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1395
 * 
 * 
 * def roll_kurt(ndarray[double_t] input,             # <<<<<<<<<<<<<<
 *                int win, int minp):
 *     cdef double val, prev
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_39roll_kurt, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_kurt, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1515
 * from skiplist cimport *
 * 
 * def roll_median_c(ndarray[float64_t] arg, int win, int minp):             # <<<<<<<<<<<<<<
 *     cdef double val, res, prev
 *     cdef:
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_41roll_median_c, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_median_c, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1570
 *     return output
 * 
 * def roll_median_cython(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_43roll_median_cython, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_median_cython, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1606
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_45roll_max2, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_max2, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1684
 *     return y
 * 
 * def roll_max(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_47roll_max, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_max, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1697
 *         return NaN
 * 
 * def roll_min(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_49roll_min, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_min, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1705
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_51roll_min2, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_min2, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1789
 *         return NaN
 * 
 * def roll_quantile(ndarray[float64_t, cast=True] input, int win,             # <<<<<<<<<<<<<<
 *                   int minp, double quantile):
 *     '''
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_53roll_quantile, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_quantile, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1836
 *     return output
 * 
 * def roll_generic(ndarray[float64_t, cast=True] input,             # <<<<<<<<<<<<<<
 *                  int win, int minp, int offset,
 *                  object func, object args, object kwargs):
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_55roll_generic, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_generic, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1885
 * 
 * 
 * def roll_window(ndarray[float64_t, ndim=1, cast=True] input,             # <<<<<<<<<<<<<<
 *                 ndarray[float64_t, ndim=1, cast=True] weights,
 *                 int minp, bint avg=True):
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_57roll_window, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_window, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1956
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def is_lexsorted(list list_of_arrays):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int i
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_59is_lexsorted, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_lexsorted, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":1989
 * 
 * @cython.boundscheck(False)
 * def groupby_indices(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_61groupby_indices, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_indices, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":2026
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_labels(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     '''
 *     Compute label vector from input values and associated useful data
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_63group_labels, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_labels, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":2068
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_65groupsort_indexer, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupsort_indexer, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":2099
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_67group_nth_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_object, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":2143
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_69group_nth_bin_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_bin_object, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":2191
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_71group_last_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_object, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":2233
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_73group_last_bin_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_bin_object, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/algos.pyx":2283
 * # median
 * 
 * def group_median(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                  ndarray[int64_t] counts,
 *                  ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_75group_median, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_median, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_77inner_join, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_79left_outer_join, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_outer_join, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/join.pyx":128
 * 
 * 
 * def full_outer_join(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                           Py_ssize_t max_groups):
 *     cdef:
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_81full_outer_join, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_full_outer_join, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/join.pyx":192
 * 
 * 
 * def _get_result_indexer(sorter, indexer):             # <<<<<<<<<<<<<<
 *     if indexer.dtype != np.int_:
 *         indexer = indexer.astype(np.int_)
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_83_get_result_indexer, NULL, __pyx_n_s_pandas_algos); 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);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_result_indexer, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/join.pyx":207
 * 
 * 
 * def ffill_indexer(ndarray[int64_t] indexer):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(indexer)
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_85ffill_indexer, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ffill_indexer, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/join.pyx":227
 * 
 * 
 * def ffill_by_group(ndarray[int64_t] indexer, ndarray[int64_t] group_ids,             # <<<<<<<<<<<<<<
 *                    int64_t max_group):
 *     cdef:
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_87ffill_by_group, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ffill_by_group, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":17
 * cimport cpython
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * isnan = np.isnan
 * 
 */
  __pyx_t_6 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":18
 * 
 * import numpy as np
 * isnan = np.isnan             # <<<<<<<<<<<<<<
 * 
 * from datetime import datetime as pydatetime
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_isnan); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnan, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "pandas/src/generated.pyx":20
 * isnan = np.isnan
 * 
 * from datetime import datetime as pydatetime             # <<<<<<<<<<<<<<
 * 
 * # this is our datetime.pxd
 */
  __pyx_t_15 = PyList_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_INCREF(__pyx_n_s_datetime);
  PyList_SET_ITEM(__pyx_t_15, 0, __pyx_n_s_datetime);
  __Pyx_GIVEREF(__pyx_n_s_datetime);
  __pyx_t_6 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_15, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_datetime); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pydatetime, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":34
 * from lib cimport is_null_datetimelike
 * 
 * cdef int64_t iNaT = get_nat()             # <<<<<<<<<<<<<<
 * 
 * # import datetime C API
 */
  __pyx_v_6pandas_5algos_iNaT = get_nat();

  /* "pandas/src/generated.pyx":37
 * 
 * # import datetime C API
 * PyDateTime_IMPORT             # <<<<<<<<<<<<<<
 * 
 * # initialize numpy
 */
  PyDateTime_IMPORT;

  /* "pandas/src/generated.pyx":40
 * 
 * # initialize numpy
 * import_array()             # <<<<<<<<<<<<<<
 * import_ufunc()
 * 
 */
  import_array();

  /* "pandas/src/generated.pyx":41
 * # 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":43
 * import_ufunc()
 * 
 * cdef int PLATFORM_INT = (<ndarray> np.arange(0, dtype=np.int_)).descr.type_num             # <<<<<<<<<<<<<<
 * 
 * cpdef ensure_platform_int(object arr):
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_arange); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_int); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_tuple__400, __pyx_t_6); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_18 = ((PyArrayObject *)__pyx_t_17)->descr->type_num;
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_v_6pandas_5algos_PLATFORM_INT = __pyx_t_18;

  /* "pandas/src/generated.pyx":262
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_117pad_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":323
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_119pad_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":384
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_121pad_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_object, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":445
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_123pad_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_int32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":506
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_125pad_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":567
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_127pad_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_bool, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":629
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_129backfill_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":691
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_131backfill_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":753
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_133backfill_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_object, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":815
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_135backfill_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_int32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":877
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_137backfill_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":939
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_139backfill_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_bool, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1002
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_141pad_inplace_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1035
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_143pad_inplace_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1068
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_145pad_inplace_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_object, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1101
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_147pad_inplace_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_int32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1134
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_149pad_inplace_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1167
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def pad_inplace_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                          ndarray[uint8_t, cast=True] mask,
 *                          limit=None):
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_151pad_inplace_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_bool, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1201
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_153backfill_inplace_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1233
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_155backfill_inplace_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1265
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_157backfill_inplace_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_object, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1297
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_159backfill_inplace_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_int32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1329
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_161backfill_inplace_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1361
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def backfill_inplace_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[uint8_t, cast=True] mask,
 *                               limit=None):
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_163backfill_inplace_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_bool, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1394
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_165pad_2d_inplace_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1428
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_167pad_2d_inplace_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1462
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_169pad_2d_inplace_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_object, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1496
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_171pad_2d_inplace_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_int32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1530
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_173pad_2d_inplace_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1564
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_175pad_2d_inplace_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_bool, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1599
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_177backfill_2d_inplace_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1633
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_179backfill_2d_inplace_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1667
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_181backfill_2d_inplace_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_object, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1701
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_183backfill_2d_inplace_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_int32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1735
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_185backfill_2d_inplace_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1769
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_187backfill_2d_inplace_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_bool, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1804
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_float64(ndarray[float64_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_189is_monotonic_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1851
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_float32(ndarray[float32_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_191is_monotonic_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1898
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_object(ndarray[object] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_193is_monotonic_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_object, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1945
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_int32(ndarray[int32_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_195is_monotonic_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_int32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":1992
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_int64(ndarray[int64_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_197is_monotonic_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2039
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def is_monotonic_bool(ndarray[uint8_t] arr, bint timelike):             # <<<<<<<<<<<<<<
 *     '''
 *     Returns
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_199is_monotonic_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_bool, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2087
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_201groupby_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2115
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_203groupby_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2143
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_205groupby_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_object, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2171
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_207groupby_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_int32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2199
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_209groupby_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2227
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_211groupby_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_bool, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2256
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_213arrmap_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2271
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_215arrmap_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2286
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_217arrmap_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_object, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2301
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_219arrmap_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_int32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2316
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_221arrmap_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2331
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_223arrmap_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_bool, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2349
 *                               ndarray[int64_t] indexer,
 *                               ndarray[uint8_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__144 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2346
 * 
 * @cython.wraparound(False)
 * def take_1d_bool_bool(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[uint8_t] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_225take_1d_bool_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_bool_bool, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2368
 *                               ndarray[int64_t] indexer,
 *                               ndarray[object] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__145 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2365
 * 
 * @cython.wraparound(False)
 * def take_1d_bool_object(ndarray[uint8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[object] out,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_227take_1d_bool_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_bool_object, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2387
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int8_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__146 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2384
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int8(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int8_t] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_229take_1d_int8_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int8_int8, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2406
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__147 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2403
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int32(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_231take_1d_int8_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int8_int32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2425
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__148 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2422
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_int64(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_233take_1d_int8_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int8_int64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2444
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__149 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2441
 * 
 * @cython.wraparound(False)
 * def take_1d_int8_float64(ndarray[int8_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_235take_1d_int8_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int8_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2463
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int16_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__150 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2460
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int16(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int16_t] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_237take_1d_int16_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int16_int16, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2482
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__151 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2479
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int32(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_239take_1d_int16_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int16_int32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2501
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__152 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2498
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_int64(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_241take_1d_int16_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int16_int64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2520
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__153 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2517
 * 
 * @cython.wraparound(False)
 * def take_1d_int16_float64(ndarray[int16_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_243take_1d_int16_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int16_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2539
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__154 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2536
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_int32(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int32_t] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_245take_1d_int32_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int32_int32, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2558
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__155 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2555
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_int64(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_247take_1d_int32_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int32_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2577
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__156 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2574
 * 
 * @cython.wraparound(False)
 * def take_1d_int32_float64(ndarray[int32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_249take_1d_int32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int32_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2596
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__157 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2593
 * 
 * @cython.wraparound(False)
 * def take_1d_int64_int64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[int64_t] out,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_251take_1d_int64_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int64_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2615
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__158 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2612
 * 
 * @cython.wraparound(False)
 * def take_1d_int64_float64(ndarray[int64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_253take_1d_int64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int64_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2634
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float32_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__159 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2631
 * 
 * @cython.wraparound(False)
 * def take_1d_float32_float32(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float32_t] out,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_255take_1d_float32_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_float32_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2653
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__160 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2650
 * 
 * @cython.wraparound(False)
 * def take_1d_float32_float64(ndarray[float32_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_257take_1d_float32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_float32_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2672
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__161 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2669
 * 
 * @cython.wraparound(False)
 * def take_1d_float64_float64(ndarray[float64_t] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[float64_t] out,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_259take_1d_float64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_float64_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2691
 *                               ndarray[int64_t] indexer,
 *                               ndarray[object] out,
 *                               fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__162 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2688
 * 
 * @cython.wraparound(False)
 * def take_1d_object_object(ndarray[object] values,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] indexer,
 *                               ndarray[object] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_261take_1d_object_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_object_object, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2712
 *                                                     int64_t[:] indexer,
 *                                                     uint8_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__163 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2759
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__164 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2756
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_bool_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_263take_2d_axis0_bool_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_bool_bool, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2813
 *                                                     int64_t[:] indexer,
 *                                                     object[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__165 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2860
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__166 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2857
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_bool_object(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_265take_2d_axis0_bool_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_bool_object, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2914
 *                                                     int64_t[:] indexer,
 *                                                     int8_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__167 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":2961
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__168 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":2958
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int8(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_267take_2d_axis0_int8_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int8_int8, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3015
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__169 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":3062
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__170 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3059
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int32(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_269take_2d_axis0_int8_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int8_int32, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3116
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__171 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":3163
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__172 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3160
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_int64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_271take_2d_axis0_int8_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int8_int64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3217
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__173 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":3264
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__174 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3261
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int8_float64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_273take_2d_axis0_int8_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int8_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3318
 *                                                     int64_t[:] indexer,
 *                                                     int16_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__175 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":3365
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__176 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3362
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int16(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_275take_2d_axis0_int16_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int16_int16, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3419
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__177 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":3466
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__178 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3463
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int32(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_277take_2d_axis0_int16_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int16_int32, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3520
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__179 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":3567
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__180 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3564
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_int64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_279take_2d_axis0_int16_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int16_int64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3621
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__181 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":3668
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__182 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3665
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int16_float64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_281take_2d_axis0_int16_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int16_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3722
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__183 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":3769
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__184 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3766
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_283take_2d_axis0_int32_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int32_int32, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3823
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__185 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":3870
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__186 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3867
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_int64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_285take_2d_axis0_int32_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int32_int64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3924
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__187 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":3971
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__188 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":3968
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int32_float64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_287take_2d_axis0_int32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int32_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4025
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__189 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":4072
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__190 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4069
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int64_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_289take_2d_axis0_int64_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int64_int64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4126
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__191 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":4173
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__192 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4170
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_int64_float64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_291take_2d_axis0_int64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int64_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4227
 *                                                     int64_t[:] indexer,
 *                                                     float32_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__193 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":4274
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__194 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4271
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float32_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_293take_2d_axis0_float32_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_float32_float32, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4328
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__195 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":4375
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__196 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4372
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float32_float64(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_295take_2d_axis0_float32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_float32_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4429
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__197 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":4476
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__198 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4473
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_float64_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_297take_2d_axis0_float64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_float64_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4530
 *                                                     int64_t[:] indexer,
 *                                                     object[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__199 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":4577
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     if values.flags.writeable:
 *         # We can call the memoryview version of the code
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__200 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4574
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis0_object_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_299take_2d_axis0_object_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_object_object, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4632
 *                                                     int64_t[:] indexer,
 *                                                     uint8_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__201 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":4659
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__202 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4656
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_bool_bool(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     uint8_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_301take_2d_axis1_bool_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_bool_bool, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4694
 *                                                     int64_t[:] indexer,
 *                                                     object[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__203 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":4721
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__204 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4718
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_bool_object(ndarray[uint8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_303take_2d_axis1_bool_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_bool_object, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4756
 *                                                     int64_t[:] indexer,
 *                                                     int8_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__205 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":4783
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__206 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4780
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int8(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int8_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_305take_2d_axis1_int8_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int8_int8, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4818
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__207 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":4845
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__208 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4842
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int32(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_307take_2d_axis1_int8_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int8_int32, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4880
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__209 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":4907
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__210 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4904
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_int64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_309take_2d_axis1_int8_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int8_int64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4942
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__211 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":4969
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__212 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":4966
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int8_float64(ndarray[int8_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_311take_2d_axis1_int8_float64, NULL, __pyx_n_s_pandas_algos); 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);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int8_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5004
 *                                                     int64_t[:] indexer,
 *                                                     int16_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__213 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5031
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__214 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5028
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int16(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int16_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_313take_2d_axis1_int16_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int16_int16, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5066
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__215 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5093
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__216 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5090
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int32(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_315take_2d_axis1_int16_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int16_int32, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5128
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__217 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5155
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__218 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5152
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_int64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_317take_2d_axis1_int16_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int16_int64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5190
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__219 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5217
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__220 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5214
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int16_float64(ndarray[int16_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_319take_2d_axis1_int16_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int16_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5252
 *                                                     int64_t[:] indexer,
 *                                                     int32_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__221 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5279
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__222 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5276
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_int32(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int32_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_321take_2d_axis1_int32_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int32_int32, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5314
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__223 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5341
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__224 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5338
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_int64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_323take_2d_axis1_int32_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int32_int64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5376
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__225 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5403
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__226 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5400
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int32_float64(ndarray[int32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_325take_2d_axis1_int32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int32_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5438
 *                                                     int64_t[:] indexer,
 *                                                     int64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__227 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5465
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__228 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5462
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int64_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     int64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_327take_2d_axis1_int64_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int64_int64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5500
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__229 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5527
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__230 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5524
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_int64_float64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_329take_2d_axis1_int64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int64_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5562
 *                                                     int64_t[:] indexer,
 *                                                     float32_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__231 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5589
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__232 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5586
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float32_float32(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float32_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_331take_2d_axis1_float32_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_float32_float32, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5624
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__233 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5651
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__234 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5648
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float32_float64(ndarray[float32_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_333take_2d_axis1_float32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_float32_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5686
 *                                                     int64_t[:] indexer,
 *                                                     float64_t[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__235 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5713
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__236 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5710
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_float64_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     float64_t[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_335take_2d_axis1_float64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_float64_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5748
 *                                                     int64_t[:] indexer,
 *                                                     object[:, :] out,
 *                                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__237 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5775
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 * 
 *     if values.flags.writeable:
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__238 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5772
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_2d_axis1_object_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                                     ndarray[int64_t] indexer,
 *                                     object[:, :] out,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_337take_2d_axis1_object_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_object_object, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5811
 *                                     indexer,
 *                                     ndarray[uint8_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__239 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5808
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_339take_2d_multi_bool_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_bool_bool, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5839
 *                                     indexer,
 *                                     ndarray[object, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__240 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5836
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_341take_2d_multi_bool_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_bool_object, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5867
 *                                     indexer,
 *                                     ndarray[int8_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__241 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5864
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_343take_2d_multi_int8_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int8_int8, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5895
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__242 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5892
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_345take_2d_multi_int8_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int8_int32, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5923
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__243 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5920
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_347take_2d_multi_int8_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int8_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5951
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__244 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5948
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_349take_2d_multi_int8_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int8_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":5979
 *                                     indexer,
 *                                     ndarray[int16_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__245 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":5976
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_351take_2d_multi_int16_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int16_int16, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6007
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__246 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6004
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_353take_2d_multi_int16_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int16_int32, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6035
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__247 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6032
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_355take_2d_multi_int16_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int16_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6063
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__248 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6060
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_357take_2d_multi_int16_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int16_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6091
 *                                     indexer,
 *                                     ndarray[int32_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__249 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6088
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_359take_2d_multi_int32_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int32_int32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6119
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__250 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6116
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_361take_2d_multi_int32_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int32_int64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6147
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__251 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6144
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_363take_2d_multi_int32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int32_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6175
 *                                     indexer,
 *                                     ndarray[int64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__252 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6172
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_365take_2d_multi_int64_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int64_int64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6203
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__253 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6200
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_367take_2d_multi_int64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int64_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6231
 *                                     indexer,
 *                                     ndarray[float32_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__254 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6228
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_369take_2d_multi_float32_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_float32_float32, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6259
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__255 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6256
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_371take_2d_multi_float32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_float32_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6287
 *                                     indexer,
 *                                     ndarray[float64_t, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_k__256 = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6284
 * @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_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_373take_2d_multi_float64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_float64_float64, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pandas/src/generated.pyx":6315
 *                                     indexer,
 *                                     ndarray[object, ndim=2] out,
 *                                     fill_value=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n, idx
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_k__257 = __pyx_t_17;
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6312
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_375take_2d_multi_object_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_object_object, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6341
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_377diff_2d_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6384
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_379diff_2d_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6427
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_381diff_2d_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_int8, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6470
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_383diff_2d_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_int16, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6513
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_385diff_2d_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_int32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6556
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_387diff_2d_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6600
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_389group_add_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_add_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6656
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_391group_add_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_add_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6713
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_393group_add_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_add_bin_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6769
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_395group_add_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_add_bin_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6826
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_397group_prod_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_prod_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6882
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_399group_prod_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_prod_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6939
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_401group_prod_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_prod_bin_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":6995
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_403group_prod_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_prod_bin_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7052
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_405group_var_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_var_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7113
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_407group_var_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_var_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7175
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_409group_var_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_var_bin_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7236
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_411group_var_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_var_bin_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7298
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_413group_mean_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_mean_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7350
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_415group_mean_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_mean_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7402
 * 
 * 
 * def group_mean_bin_float64(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_417group_mean_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_mean_bin_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7455
 *                 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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_419group_mean_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_mean_bin_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7510
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_421group_ohlc_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_ohlc_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7584
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_423group_ohlc_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_ohlc_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7659
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_425group_last_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7702
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_427group_last_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7745
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[int64_t, ndim=2] values,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_429group_last_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7789
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_431group_last_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_bin_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7833
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_433group_last_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_bin_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7877
 * @cython.wraparound(False)
 * @cython.wraparound(False)
 * def group_last_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[int64_t, ndim=2] values,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_435group_last_bin_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_bin_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7922
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_437group_nth_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":7966
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_439group_nth_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8010
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[int64_t, ndim=2] values,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_441group_nth_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8055
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_443group_nth_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_bin_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8100
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_445group_nth_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_bin_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8145
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[int64_t, ndim=2] values,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_447group_nth_bin_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_bin_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8191
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_449group_min_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8251
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_451group_min_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8311
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[int64_t, ndim=2] values,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_453group_min_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8372
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_455group_min_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_bin_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8433
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_457group_min_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_bin_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8494
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_min_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[int64_t, ndim=2] values,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_459group_min_bin_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_bin_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8556
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_461group_max_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8616
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_463group_max_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8676
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[int64_t, ndim=2] values,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_465group_max_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8737
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_467group_max_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_bin_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8797
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_469group_max_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_bin_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8857
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_max_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[int64_t, ndim=2] values,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_471group_max_bin_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_bin_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8918
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_473group_count_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8954
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_475group_count_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":8990
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[int64_t, ndim=2] values,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_477group_count_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":9026
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[object, ndim=2] values,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_479group_count_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_object, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":9062
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                          ndarray[int64_t] counts,
 *                          ndarray[int64_t, ndim=2] values,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_481group_count_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":9099
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_483group_count_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_bin_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":9133
 * @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_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_485group_count_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_bin_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":9167
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[int64_t, ndim=2] values,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_487group_count_bin_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_bin_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":9201
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_object(ndarray[object, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[object, ndim=2] values,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_489group_count_bin_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_bin_object, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":9235
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_count_bin_int64(ndarray[int64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                              ndarray[int64_t] counts,
 *                              ndarray[int64_t, ndim=2] values,
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_491group_count_bin_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_bin_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":9270
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[float64_t] right):
 *     cdef:
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_493left_join_indexer_unique_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":9315
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[float32_t] right):
 *     cdef:
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_495left_join_indexer_unique_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":9360
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[object] right):
 *     cdef:
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_497left_join_indexer_unique_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_object, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":9405
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[int32_t] right):
 *     cdef:
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_499left_join_indexer_unique_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_int32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":9450
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_indexer_unique_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                                       ndarray[int64_t] right):
 *     cdef:
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_501left_join_indexer_unique_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":9495
 * 
 * 
 * def left_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float64_t] right):
 *     '''
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_503left_join_indexer_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":9597
 * 
 * 
 * def left_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float32_t] right):
 *     '''
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_505left_join_indexer_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":9699
 * 
 * 
 * def left_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                               ndarray[object] right):
 *     '''
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_507left_join_indexer_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_object, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":9801
 * 
 * 
 * def left_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int32_t] right):
 *     '''
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_509left_join_indexer_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_int32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":9903
 * 
 * 
 * def left_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] right):
 *     '''
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_511left_join_indexer_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":10007
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[float64_t] right):
 *     cdef:
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_513outer_join_indexer_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":10136
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[float32_t] right):
 *     cdef:
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_515outer_join_indexer_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":10265
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[object] right):
 *     cdef:
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_517outer_join_indexer_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_object, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":10394
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[int32_t] right):
 *     cdef:
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_519outer_join_indexer_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_int32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":10523
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def outer_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                                 ndarray[int64_t] right):
 *     cdef:
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_521outer_join_indexer_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":10653
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_float64(ndarray[float64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float64_t] right):
 *     '''
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_523inner_join_indexer_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_float64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":10746
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_float32(ndarray[float32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[float32_t] right):
 *     '''
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_525inner_join_indexer_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_float32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":10839
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_object(ndarray[object] left,             # <<<<<<<<<<<<<<
 *                               ndarray[object] right):
 *     '''
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_527inner_join_indexer_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_object, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":10932
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_int32(ndarray[int32_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int32_t] right):
 *     '''
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_529inner_join_indexer_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_int32, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/src/generated.pyx":11025
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def inner_join_indexer_int64(ndarray[int64_t] left,             # <<<<<<<<<<<<<<
 *                               ndarray[int64_t] right):
 *     '''
 */
  __pyx_t_17 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_531inner_join_indexer_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_int64, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "pandas/algos.pyx":1
 * from numpy cimport *             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * import numpy as np
 */
  __pyx_t_17 = PyDict_New(); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "View.MemoryView":203
 *         info.obj = self
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(array self):
 */
  __pyx_t_17 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 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_17 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__817, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_XGOTREF(generic);
  __Pyx_DECREF_SET(generic, __pyx_t_17);
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 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_17 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__818, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_XGOTREF(strided);
  __Pyx_DECREF_SET(strided, __pyx_t_17);
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 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_17 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__819, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_XGOTREF(indirect);
  __Pyx_DECREF_SET(indirect, __pyx_t_17);
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "View.MemoryView":281
 * 
 * 
 * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
 * 
 */
  __pyx_t_17 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__820, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_XGOTREF(contiguous);
  __Pyx_DECREF_SET(contiguous, __pyx_t_17);
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "View.MemoryView":282
 * 
 * cdef contiguous = Enum("<contiguous and direct>")
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_17 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__821, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_XGOTREF(indirect_contiguous);
  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_17);
  __Pyx_GIVEREF(__pyx_t_17);
  __pyx_t_17 = 0;

  /* "View.MemoryView":496
 *         info.obj = self
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_17 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  PyType_Modified(__pyx_memoryview_type);

  /* "View.MemoryView":952
 *             return self.from_object
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_17 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 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)
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  if (__pyx_m) {
    if (__pyx_d) {
      __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

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 (likely(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 (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject* args = PyTuple_Pack(1, arg);
    return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
}
#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 CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

#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 (PyType_Check(type)) {
#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;
        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;
        }
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
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) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        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);
        }
#endif
    }
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)
        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;
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break;
      }
      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;
        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;
        }
        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':
        {
          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;
          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 '}':
        {
          size_t alignment = ctx->struct_alignment;
          ++ts;
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          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 PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *function = PyMethod_GET_FUNCTION(method);
            result = __Pyx_PyObject_CallOneArg(function, self);
            Py_DECREF(method);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                             int is_tuple, int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
        iternextfunc iternext;
        iter = PyObject_GetIter(tuple);
        if (unlikely(!iter)) goto bad;
        if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
        iternext = Py_TYPE(iter)->tp_iternext;
        value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
        value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
        if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
        Py_DECREF(iter);
    } else {
        if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
            __Pyx_UnpackTupleError(tuple, 2);
            goto bad;
        }
#if CYTHON_COMPILING_IN_PYPY
        value1 = PySequence_ITEM(tuple, 0);
        if (unlikely(!value1)) goto bad;
        value2 = PySequence_ITEM(tuple, 1);
        if (unlikely(!value2)) goto bad;
#else
        value1 = PyTuple_GET_ITEM(tuple, 0);
        value2 = PyTuple_GET_ITEM(tuple, 1);
        Py_INCREF(value1);
        Py_INCREF(value2);
#endif
        if (decref_tuple) { Py_DECREF(tuple); }
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
#if !CYTHON_COMPILING_IN_PYPY
    if (is_dict) {
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
    }
#endif
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos,
                                              PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

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;
    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 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_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            goto bad;
        PyErr_Clear();
        r = d;
        Py_INCREF(d);
    }
    return r;
bad:
    return NULL;
}

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 (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        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, (size_t)(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 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
    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;
    }
    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}
};
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[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
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;
    __Pyx_CyFunction_weakreflist(op) = 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 (__Pyx_CyFunction_weakreflist(m) != 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 __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_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 (%" CYTHON_FORMAT_SSIZE_T "d 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 (%" CYTHON_FORMAT_SSIZE_T "d 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)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_Call,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#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;
}
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,
     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)
    "fused_cython_function",
    sizeof(__pyx_FusedFunctionObject),
    0,
    (destructor) __pyx_FusedFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    0,
    0,
    0,
    &__pyx_FusedFunction_mapping_methods,
    0,
    (ternaryfunc) __pyx_FusedFunction_call,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    0,
    (traverseproc) __pyx_FusedFunction_traverse,
    (inquiry) __pyx_FusedFunction_clear,
    0,
    0,
    0,
    0,
    0,
    __pyx_FusedFunction_members,
    __pyx_CyFunction_getsets,
    &__pyx_CyFunctionType_type,
    0,
    __pyx_FusedFunction_descr_get,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#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_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, (size_t)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,
        0,
        0,
        0,
        0,
        __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,
        __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;
    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_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*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_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_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;
        }
        #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
        }
    }
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 (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
        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);
    PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
    return -1;
}
static void __Pyx_ReleaseBuffer(Py_buffer *view) {
    PyObject *obj = view->obj;
    if (!obj) return;
    if (PyObject_CheckBuffer(obj)) {
        PyBuffer_Release(view);
        return;
    }
        if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
    Py_DECREF(obj);
    view->obj = NULL;
}
#endif


                #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
    {                                                                     \
        func_type value = func_value;                                     \
        if (sizeof(target_type) < sizeof(func_type)) {                    \
            if (unlikely(value != (func_type) (target_type) value)) {     \
                func_type zero = 0;                                       \
                if (is_unsigned && unlikely(value < zero))                \
                    goto raise_neg_overflow;                              \
                else                                                      \
                    goto raise_overflow;                                  \
            }                                                             \
        }                                                                 \
        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(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            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
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_int8, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(npy_int8) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(npy_int8, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(npy_int8) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int8, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_int8,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(npy_int8, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(npy_int8) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(npy_int8, long, PyLong_AsLong(x))
            } else if (sizeof(npy_int8) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int8, long long, PyLong_AsLongLong(x))
            }
        }
        {
#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;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to npy_int8");
    return (npy_int8) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to npy_int8");
    return (npy_int8) -1;
}

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(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            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
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_int16, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(npy_int16) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(npy_int16, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(npy_int16) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int16, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_int16,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(npy_int16, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(npy_int16) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(npy_int16, long, PyLong_AsLong(x))
            } else if (sizeof(npy_int16) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int16, long long, PyLong_AsLongLong(x))
            }
        }
        {
#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;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to npy_int16");
    return (npy_int16) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to npy_int16");
    return (npy_int16) -1;
}

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(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            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
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(npy_int32) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_int32,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(npy_int32) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong(x))
            } else if (sizeof(npy_int32) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int32, long long, PyLong_AsLongLong(x))
            }
        }
        {
#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;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to npy_int32");
    return (npy_int32) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to npy_int32");
    return (npy_int32) -1;
}

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(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            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
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_int64, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(npy_int64) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_int64,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(npy_int64, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(npy_int64) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(npy_int64, long, PyLong_AsLong(x))
            } else if (sizeof(npy_int64) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int64, long long, PyLong_AsLongLong(x))
            }
        }
        {
#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;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to npy_int64");
    return (npy_int64) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to npy_int64");
    return (npy_int64) -1;
}

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);
    }
}

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(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            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
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
            }
        }
        {
#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;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

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);
    }
}

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(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            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
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(char, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(char) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(char, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(char) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(char, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(char,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(char) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(char, long, PyLong_AsLong(x))
            } else if (sizeof(char) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(char, long long, PyLong_AsLongLong(x))
            }
        }
        {
#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;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to char");
    return (char) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to char");
    return (char) -1;
}

static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character) {
    const Py_ssize_t length = PyBytes_GET_SIZE(bytes);
    char* char_start = PyBytes_AS_STRING(bytes);
    char* pos;
    for (pos=char_start; pos < char_start+length; pos++) {
        if (character == pos[0]) return 1;
    }
    return 0;
}

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);
    }
}

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(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            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
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_uint8, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(npy_uint8) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(npy_uint8) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_uint8,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(npy_uint8, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(npy_uint8) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyLong_AsLong(x))
            } else if (sizeof(npy_uint8) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint8, long long, PyLong_AsLongLong(x))
            }
        }
        {
#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;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to npy_uint8");
    return (npy_uint8) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to npy_uint8");
    return (npy_uint8) -1;
}

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);
    }
}

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(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            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
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_uint16, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(npy_uint16) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint16, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(npy_uint16) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint16, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_uint16,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(npy_uint16, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(npy_uint16) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint16, long, PyLong_AsLong(x))
            } else if (sizeof(npy_uint16) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint16, long long, PyLong_AsLongLong(x))
            }
        }
        {
#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;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to npy_uint16");
    return (npy_uint16) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to npy_uint16");
    return (npy_uint16) -1;
}

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);
    }
}

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(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            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
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_uint32, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(npy_uint32) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(npy_uint32) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_uint32,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(npy_uint32, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(npy_uint32) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyLong_AsLong(x))
            } else if (sizeof(npy_uint32) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint32, long long, PyLong_AsLongLong(x))
            }
        }
        {
#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;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to npy_uint32");
    return (npy_uint32) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to npy_uint32");
    return (npy_uint32) -1;
}

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);
    }
}

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(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            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
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(npy_uint64) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(npy_uint64) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_uint64,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(npy_uint64, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(npy_uint64) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint64, long, PyLong_AsLong(x))
            } else if (sizeof(npy_uint64) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(npy_uint64, long long, PyLong_AsLongLong(x))
            }
        }
        {
#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;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to npy_uint64");
    return (npy_uint64) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to npy_uint64");
    return (npy_uint64) -1;
}

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
    cobj = PyCapsule_New(p, sig, NULL);
#else
    cobj = PyCObject_FromVoidPtr(p, NULL);
#endif
    return cobj;
}

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(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            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
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
            }
        }
        {
#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;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

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);
        return PyErr_WarnEx(NULL, message, 1);
    }
    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 (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    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

#ifndef __PYX_HAVE_RT_ImportFunction
#define __PYX_HAVE_RT_ImportFunction
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, funcname);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%.200s does not export expected C function %.200s",
                PyModule_GetName(module), funcname);
        goto bad;
    }
#if PY_VERSION_HEX >= 0x02070000
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    tmp.p = PyCapsule_GetPointer(cobj, sig);
#else
    {const char *desc, *s1, *s2;
    desc = (const char *)PyCObject_GetDesc(cobj);
    if (!desc)
        goto bad;
    s1 = desc; s2 = sig;
    while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
    if (*s1 != *s2) {
        PyErr_Format(PyExc_TypeError,
            "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), funcname, sig, desc);
        goto bad;
    }
    tmp.p = PyCObject_AsVoidPtr(cobj);}
#endif
    *f = tmp.fp;
    if (!(*f))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

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
        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, (Py_ssize_t)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
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_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
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if !CYTHON_COMPILING_IN_PYPY
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#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;
}
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
    return PyLong_AsSsize_t(b);
  }
  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) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
