Skip to content

Commit

Permalink
Backport PR pandas-dev#57668: CLN: More numpy 2 stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
lithomas1 authored and meeseeksmachine committed Mar 2, 2024
1 parent 9a07184 commit 756d123
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pandas/_libs/src/vendored/ujson/python/objToJSON.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ typedef struct __NpyArrContext {
npy_intp ndim;
npy_intp index[NPY_MAXDIMS];
int type_num;
PyArray_GetItemFunc *getitem;

char **rowLabels;
char **columnLabels;
Expand Down Expand Up @@ -405,7 +404,6 @@ static void NpyArr_iterBegin(JSOBJ _obj, JSONTypeContext *tc) {
}

npyarr->array = (PyObject *)obj;
npyarr->getitem = (PyArray_GetItemFunc *)PyArray_DESCR(obj)->f->getitem;
npyarr->dataptr = PyArray_DATA(obj);
npyarr->ndim = PyArray_NDIM(obj) - 1;
npyarr->curdim = 0;
Expand Down Expand Up @@ -492,7 +490,7 @@ static int NpyArr_iterNextItem(JSOBJ obj, JSONTypeContext *tc) {
((PyObjectEncoder *)tc->encoder)->npyValue = npyarr->dataptr;
((PyObjectEncoder *)tc->encoder)->npyCtxtPassthru = npyarr;
} else {
GET_TC(tc)->itemValue = npyarr->getitem(npyarr->dataptr, npyarr->array);
GET_TC(tc)->itemValue = PyArray_GETITEM(arrayobj, npyarr->dataptr);
}

npyarr->dataptr += npyarr->stride;
Expand Down

0 comments on commit 756d123

Please sign in to comment.