Q:

How to join multiple rows sequentially in a numpy array?

I've a data like this,
data = [array(['a', 'b', 'c']), 
        array([['d', 'e', 'f'], ['g', 'h', 'i']]), 
        array([['j', 'k', 'l'], ['m', 'n', 'o'], ['p', 'q', 'r']])]

I want to join values in inner list sequentially. This is the desired output that I need.
[['a', 'b', 'c'], ['d g', 'e h', 'f i'], ['j m p', 'k n q', 'l o r']]

I tried using using multiple loops and join but it's not giving me required output.
for i in data:
    for j in i:
        print(" ".join(j))

I'm not really sure on how to achieve this? Need an efficient and faster approach because my original data is really large.

A:

In [300]: [np.array([' '.join(ij) for ij in zip(*np.atleast_2d(row))]) for row in data]        
Out[300]: 
[array(['a', 'b', 'c'], dtype='<U1'),
 array(['d g', 'e h', 'f i'], dtype='<U3'),
 array(['j m p', 'k n q', 'l o r'], dtype='<U5')]

The first array is 1d, thus requiring the atleast_2d for consistency.  Most the rest is just iterative application of string join.

