Skip to content

Commit c1caf7f

Browse files
committed
Use a fused type
1 parent e6a831f commit c1caf7f

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

pandas/lib.pyx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,13 +899,29 @@ def clean_index_list(list obj):
899899

900900
return maybe_convert_objects(converted), 0
901901

902+
903+
ctypedef fused pandas_t:
904+
str
905+
unicode
906+
float32_t
907+
float64_t
908+
uint8_t
909+
uint16_t
910+
uint32_t
911+
uint64_t
912+
int8_t
913+
int16_t
914+
int32_t
915+
int64_t
916+
917+
902918
@cython.boundscheck(False)
903919
@cython.wraparound(False)
904-
def max_len_string_array(ndarray[object] arr):
920+
def max_len_string_array(pandas_t[:] arr):
905921
""" return the maximum size of elements in a 1-dim string array """
906922
cdef:
907923
Py_ssize_t i, m = 0, l = 0, length = arr.shape[0]
908-
object v
924+
pandas_t v
909925

910926
for i in range(length):
911927
v = arr[i]

0 commit comments

Comments
 (0)