[sage-support] Re: matrix basics

2007-07-27 Thread Dan Christensen
"William Stein" <[EMAIL PROTECTED]> writes: > Naive question: what exactly is broadcasting, and how might it be > useful in the context of SAGE? Joshua Kantor explained in more detail, but simply being able to do a[:,1:3] += 2 to add 2 to a portion of an array is already an illustration. Note t

[sage-support] Re: matrix basics

2007-07-27 Thread Joshua Kantor
Regarding the question about broadcating. Every numpy array has a shape parameter. By manipulating this you can control how an array of data is viewed and . A simple example is sage: import numpy sage: a=numpy.array(range(8)) sage: a array([ 0, 1, 2, 3, 4, 5, 6, 7]) sage: a.shape=(2,4) sag

[sage-support] Re: matrix basics

2007-07-26 Thread William Stein
On 7/26/07, Dan Christensen <[EMAIL PROTECTED]> wrote: > > There is no SAGE equivalent yet. > > I really miss the numpy syntax, including broadcasting. For example, Naive question: what exactly is broadcasting, and how might it be useful in the context of SAGE? Probably it's something to add to

[sage-support] Re: matrix basics

2007-07-26 Thread Dan Christensen
"William Stein" <[EMAIL PROTECTED]> writes: > On 7/26/07, David Joyner <[EMAIL PROTECTED]> wrote: >> On 7/26/07, mak <[EMAIL PROTECTED]> wrote: >> > 1. How do I change the entire row or column of a matrix at once? In >> > pari, I could do e.g. a=[1,2,3;4,5,6], and then put a[1,]=[0,0,0], >> > w

[sage-support] Re: matrix basics

2007-07-26 Thread William Stein
On 7/26/07, David Joyner <[EMAIL PROTECTED]> wrote: > On 7/26/07, mak <[EMAIL PROTECTED]> wrote: > > 1. How do I change the entire row or column of a matrix at once? In > > pari, I could do e.g. a=[1,2,3;4,5,6], and then put a[1,]=[0,0,0], > > which would give a=[0,0,0;4,5,6]. What's the sage e

[sage-support] Re: matrix basics

2007-07-26 Thread David Joyner
On 7/26/07, mak <[EMAIL PROTECTED]> wrote: > > 1. How do I change the entire row or column of a matrix at once? In > pari, I could do e.g. a=[1,2,3;4,5,6], and then put a[1,]=[0,0,0], > which would give a=[0,0,0;4,5,6]. What's the sage equivalent? sage: a=[[1,2,3],[4,5,6]] sage: A = matrix(a)