Re: [Tutor] 1d to 2d array creation

2012-10-01 Thread Oscar Benjamin
On 1 October 2012 22:04, Bala subramanian wrote: > Friends, > I have an 1d array like a=[1, 1, 2, 2, 2, 3, 3, 1, 1, 1], i have to > convert it to 2d array for plotting as follows. The 2d array is filled > by a[colum index] to obtain the new array shown below. > > [ [ 1., 1., 0., 0., 0., 0.,

[Tutor] 1d to 2d array creation

2012-10-01 Thread Bala subramanian
Friends, I have an 1d array like a=[1, 1, 2, 2, 2, 3, 3, 1, 1, 1], i have to convert it to 2d array for plotting as follows. The 2d array is filled by a[colum index] to obtain the new array shown below. [ [ 1., 1., 0., 0., 0., 0., 0., 1., 1., 1.], [ 0., 0., 2., 2., 2., 0., 0., 0.