On 26 October 2010 21:02, Dewald Pieterse wrote:
> I see my slicing was the problem, np.vstack((test[:1], test)) works
> perfectly.
Yes and no. np.newaxis (or "None" for short) is a very useful tool;
you just stick it in an index expression and it adds an axis of length
one there. If what you rea
I see my slicing was the problem, np.vstack((test[:1], test)) works
perfectly.
On Wed, Oct 27, 2010 at 12:55 AM, wrote:
> On Tue, Oct 26, 2010 at 8:15 PM, Dewald Pieterse
> wrote:
> > Starting with:
> >
> >> In [93]: test =
> >> numpy.array([[[1,1,1],[1,1,1]],[[2,2,2],[2,2,2]],[[3,3,3],[3,3,3]]
On Tue, Oct 26, 2010 at 8:15 PM, Dewald Pieterse
wrote:
> Starting with:
>
>> In [93]: test =
>> numpy.array([[[1,1,1],[1,1,1]],[[2,2,2],[2,2,2]],[[3,3,3],[3,3,3]]])
>>
>> In [94]: test
>> Out[94]:
>> array([[[1, 1, 1],
>> [1, 1, 1]],
>>
>> [[2, 2, 2],
>> [2, 2, 2]],
>>
>>
Starting with:
In [93]: test =
> numpy.array([[[1,1,1],[1,1,1]],[[2,2,2],[2,2,2]],[[3,3,3],[3,3,3]]])
>
> In [94]: test
> Out[94]:
> array([[[1, 1, 1],
> [1, 1, 1]],
>
>[[2, 2, 2],
> [2, 2, 2]],
>
>[[3, 3, 3],
> [3, 3, 3]]])
>
> Slicing the complete first ro