Want to convert the following numpy a array
a = [ array([['x', 'y', 'k'], ['d', '2', 'z'], ['a', '15', 'r']], dtype='|S2'), array([['p', '49'], ['l', 'n']], dtype='|S2'), array([['5', 'y'], ['33', 'u'], ['v', 'z']], dtype='|S2'), array([['f', 'i'], ['c', 'm'], ['u', '98']] dtype='|S2') ]
to exit b
b = x!yd!2.a!15 * x!kd!za!r , p!49.l!n , 5!y.33!uv!z , f!ic!mu!98
Consider each subobject similar to this.
#x #y #k #d #2 #z #a #15 #r
Then combine the 0 and 1 columns with '!' and each line with '.' Then merge 0 and 2 columns. And so on. Here, columns 0,1 and 0,2 are combined using '*' AND ',' is used to combine sub-arrays
Just merging strings with '!' '.' '*' ',' '!' '.' '*' ','
I tried the following code. Failed to get result though
temp = [] for c in a: temp = a[0:] b = " * ".join(".".join(var1+"!"+var2 for var1,var2 in zip(temp,a) for row in a) print b print " , "