Here's an example of what I want to do. I want to take b and add this to my array but in a particular format (again I just want to know the steps to do this, my code deals with strings):
import numpy as np
a = np.zeros(25, dtype= np.character).reshape(5,5)
b = [1,2,3,4,5,6,7,8,9]
for i in b:
a[1:4,1:4] = i
print a
Output:
[['' '' '' '' '']
['' '9' '9' '9' '']
['' '9' '9' '9' '']
['' '9' '9' '9' '']
['' '' '' '' '']]
But what I want is this:
[['' '' '' '' '']
['' '1' '2' '3' '']
['' '4' '5' '6' '']
['' '7' '8' '9' '']
['' '' '' '' '']]
Could anyone give me an idea on how to do this? Thank you.