Skip to content

Commit ba26b4c

Browse files
committed
BLD: add cppsandbox.pyx, close #372
1 parent a1f7e5b commit ba26b4c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pandas/src/cppsandbox.pyx

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from libcpp.map cimport map
2+
from numpy cimport ndarray, int32_t
3+
4+
ctypedef int32_t i4
5+
6+
def map_indices(ndarray[i4] values):
7+
cdef:
8+
i4 i, n
9+
map[i4, i4] mapping
10+
11+
mapping = map[i4, i4]()
12+
13+
n = len(values)
14+
for i in range(n):
15+
mapping[i] = values[i]
16+
17+

0 commit comments

Comments
 (0)