Good day.
I am trying to obtain MAXIMUM speed for this mappings:
MyString = '\n'.join([ ''.join([j.encode('utf8') for j in i]) for i in
NdArrayList ])
"NdArrayList" is a list of numpy ndarrays that contain one Unicode character
and i want to transform it into a string, AS FAST AS POSSIBLE.
For example : NdArrayList can be = [ np.array([u'a', u'\u2588'], dtype='<U1'),
np.array([u'\u00a9', u'\u00ce', u'\u2022'], dtype='<U1') ]
I also want to make MyList = [ ''.join([j.encode('utf8') for j in i]) for i in
NdArrayList ]. In this case i need a list of united-as-string numpy ndarrays.
When i call the codes from Python i get better performance than compiling into
a Cython function like:
cdef str __Ndarray2String( list TempA ):
#
return '\n'.join([ ''.join([j.encode('utf8') for j in i]) for i in TempA ])
#
def Ndarray2String( v ):
return __Ndarray2String( v )
Can anyone please sugest a good method?
Thank you in advance.
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev