"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
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
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
"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
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
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)