diff --git a/pandas/_libs/algos.pyx b/pandas/_libs/algos.pyx index b54ab9030e4a1..ed251c401c277 100644 --- a/pandas/_libs/algos.pyx +++ b/pandas/_libs/algos.pyx @@ -1371,8 +1371,8 @@ ctypedef fused out_t: @cython.boundscheck(False) @cython.wraparound(False) def diff_2d( - # TODO: cython bug (post Cython 3) preventsupdate to "const diff_t[:, :] arr" - diff_t[:, :] arr, + # TODO: cython bug (post Cython 3) prevents update to "const diff_t[:, :] arr" + ndarray[diff_t, ndim=2] arr, out_t[:, :] out, Py_ssize_t periods, int axis, @@ -1380,7 +1380,9 @@ def diff_2d( ): cdef: Py_ssize_t i, j, sx, sy, start, stop - bint f_contig = arr.is_f_contig() + bint f_contig = arr.flags.f_contiguous + # TODO: change to this when arr becomes a memoryview + # bint f_contig = arr.is_f_contig() diff_t left, right # Disable for unsupported dtype combinations, diff --git a/pandas/_libs/groupby.pyx b/pandas/_libs/groupby.pyx index 1d63030de026e..3384060f74c20 100644 --- a/pandas/_libs/groupby.pyx +++ b/pandas/_libs/groupby.pyx @@ -1545,7 +1545,12 @@ def group_nth( if uses_mask: isna_entry = mask[i, j] else: - isna_entry = _treat_as_na(val, is_datetimelike) + # TODO: just make _treat_as_na support this? + # remove notimplemented for object dtype there + if numeric_object_t is object: + isna_entry = checknull(val) + else: + isna_entry = _treat_as_na(val, is_datetimelike) if not isna_entry: nobs[lab, j] += 1