On 26 October 2010 21:02, Dewald Pieterse dewald.piete...@gmail.com 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
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 row:
In [95]:
On Tue, Oct 26, 2010 at 8:15 PM, Dewald Pieterse
dewald.piete...@gmail.com 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]],
I see my slicing was the problem, np.vstack((test[:1], test)) works
perfectly.
On Wed, Oct 27, 2010 at 12:55 AM, josef.p...@gmail.com wrote:
On Tue, Oct 26, 2010 at 8:15 PM, Dewald Pieterse
dewald.piete...@gmail.com wrote:
Starting with:
In [93]: test =