how convert integers in a matrix to their corresponding alphabets in python -


i trying convert matrix of integers corresponding alphabet in python. 1=a,b=2 etc have far xlabels matrix integers.

a = np.zeros((15,15)) x in xrange(0,15):     y in xrange(0,15):         a[x, y] = chr(ord('a')-1 + xlabels[0, 0]) print(a) 

but error saying

valueerror: not convert string float: n 

replace:

a = np.zeros((15,15)) 

with:

a = np.zeros((15,15), dtype=str) 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -