Skip to content

Commit 61f44ce

Browse files
jrebackwesm
authored andcommitted
not cdefing an index variable!
1 parent 62cff78 commit 61f44ce

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

pandas/lib.pyx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -749,26 +749,26 @@ from cpython cimport (PyDict_New, PyDict_GetItem, PyDict_SetItem,
749749

750750
@cython.boundscheck(False)
751751
@cython.wraparound(False)
752-
def create_hdf_rows_2d(ndarray index, ndarray[np.uint8_t, ndim=1] mask,
752+
def create_hdf_rows_2d(ndarray indexer0, ndarray[np.uint8_t, ndim=1] mask,
753753
list values):
754754
""" return a list of objects ready to be converted to rec-array format """
755755

756756
cdef:
757-
unsigned int i, b, n_index, n_blocks, tup_size
757+
unsigned int i, b, n_indexer0, n_blocks, tup_size
758758
ndarray v
759759
list l
760760
object tup, val
761761

762-
n_index = index.shape[0]
763-
n_blocks = len(values)
764-
tup_size = n_blocks+1
762+
n_indexer0 = indexer0.shape[0]
763+
n_blocks = len(values)
764+
tup_size = n_blocks+1
765765
l = []
766-
for i from 0 <= i < n_index:
766+
for i from 0 <= i < n_indexer0:
767767

768768
if not mask[i]:
769769

770770
tup = PyTuple_New(tup_size)
771-
val = index[i]
771+
val = indexer0[i]
772772
PyTuple_SET_ITEM(tup, 0, val)
773773
Py_INCREF(val)
774774

@@ -784,40 +784,40 @@ def create_hdf_rows_2d(ndarray index, ndarray[np.uint8_t, ndim=1] mask,
784784

785785
@cython.boundscheck(False)
786786
@cython.wraparound(False)
787-
def create_hdf_rows_3d(ndarray index, ndarray columns,
787+
def create_hdf_rows_3d(ndarray indexer0, ndarray indexer1,
788788
ndarray[np.uint8_t, ndim=2] mask, list values):
789789
""" return a list of objects ready to be converted to rec-array format """
790790

791791
cdef:
792-
unsigned int i, j, n_columns, n_index, n_blocks, tup_size
792+
unsigned int i, j, b, n_indexer0, n_indexer1, n_blocks, tup_size
793793
ndarray v
794794
list l
795795
object tup, val
796796

797-
n_index = index.shape[0]
798-
n_columns = columns.shape[0]
799-
n_blocks = len(values)
800-
tup_size = n_blocks+2
797+
n_indexer0 = indexer0.shape[0]
798+
n_indexer1 = indexer1.shape[0]
799+
n_blocks = len(values)
800+
tup_size = n_blocks+2
801801
l = []
802-
for i from 0 <= i < n_index:
802+
for i from 0 <= i < n_indexer0:
803803

804-
for c from 0 <= c < n_columns:
804+
for j from 0 <= j < n_indexer1:
805805

806-
if not mask[i, c]:
806+
if not mask[i, j]:
807807

808808
tup = PyTuple_New(tup_size)
809809

810-
val = index[i]
810+
val = indexer0[i]
811811
PyTuple_SET_ITEM(tup, 0, val)
812812
Py_INCREF(val)
813813

814-
val = columns[c]
814+
val = indexer1[j]
815815
PyTuple_SET_ITEM(tup, 1, val)
816816
Py_INCREF(val)
817817

818818
for b from 0 <= b < n_blocks:
819819

820-
v = values[b][:, i, c]
820+
v = values[b][:, i, j]
821821
PyTuple_SET_ITEM(tup, b+2, v)
822822
Py_INCREF(v)
823823

0 commit comments

Comments
 (0)