Any flag for this? Please, see the intended.
>>> numpy.column_stack([[1], [1,2]])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/pymodules/python2.7/numpy/lib/shape_base.py", line 296, in column_stack
return _nx.concatenate(arrays,1)
ValueError: array dimensions must agree except for d_0
Input
[[1],[1,2]]
Intended Output
[[NA,1], [1,2]]
In general
[[1],[2,2],[3,3,3],...,[n,n,n,n,n...,n]]
to
[[NA, NA, NA,..., NA,1], [NA, NA, ..., 2, 2], ...[n,n,n,n,n]]
where the columns may be a triangluar zero matrix initially. Yes you can understand the term NA as None. I got the triangular matrix almost below.
>>> a=[[1],[2,2],[3,3,3]]
>>> a
[[1], [2, 2], [3, 3, 3]]
>>> len(a)
3
>>> [aa+['']*(N-len(aa)) for
...
KeyboardInterrupt
>>> N=len(a)
>>> [aa+['']*(N-len(aa)) for aa in a]
[[1, '', ''], [2, 2, ''], [3, 3, 3]]
>>> transpose([aa+['']*(N-len(aa)) for aa in a])
array([['1', '2', '3'],
['', '2', '3'],
['', '', '3']],
dtype='|S4')