not supported in pure Python. However, it could add a lot of readability and
programming easiness to Sage because a common task as a scientist is to
manipulate and transform a lot of data and (I think) the most basic
container to do that is a list.
IMHO, an expression like 1 + [2,3,4,5] is
William Stein wrote:
On Sun, Aug 2, 2009 at 9:13 AM, Robert Dodierrobert.dod...@gmail.com wrote:
Robert Bradshaw wrote:
Sage lists are Python lists, which are very different than
Mathematica lists.
You say that as if it's a fact of geography which can't be changed.
to change all lists
Robert Bradshaw wrote:
Sage lists are Python lists, which are very different than
Mathematica lists.
You say that as if it's a fact of geography which can't be changed.
to change all lists would be a massive (backwards-
incompatible) change, as well as another step away from Python.
Not
On Sun, Aug 2, 2009 at 9:13 AM, Robert Dodierrobert.dod...@gmail.com wrote:
Robert Bradshaw wrote:
Sage lists are Python lists, which are very different than
Mathematica lists.
You say that as if it's a fact of geography which can't be changed.
to change all lists would be a massive
On Sun, Aug 2, 2009 at 2:00 PM, William Stein wst...@gmail.com wrote:
On Sun, Aug 2, 2009 at 9:13 AM, Robert Dodierrobert.dod...@gmail.com
wrote:
Robert Bradshaw wrote:
Sage lists are Python lists, which are very different than
Mathematica lists.
You say that as if it's a fact of
Hi,
Bill Page escribió:
[ x ] No, I can read the above just fine. It is crystal clear.
... but of course unnecessarily verbose. In my opinion a more common
notation in Sage:
sage: x=2*vector(range(10))+vector(10*[3])
sage: list_plot(map(lambda a:[cos(a),sin(a)],x/max(x)))
is
[[cos(a/9), sin(a/9)] for a in [b+3 for b in [2*c for c in [1,2,3
(This is using a/9 instead of a/max(z) since I don't know how to do
'max(z)' in a one-liner like this.)
Thanks John, when I was talking about unreadable comprehensions I was
meaning this. i.e. nested ones. Then was when I
Carlos Córdoba ha scritto:
[[cos(a/9), sin(a/9)] for a in [b+3 for b in [2*c for c in [1,2,3
(This is using a/9 instead of a/max(z) since I don't know how to do
'max(z)' in a one-liner like this.)
Thanks John, when I was talking about unreadable comprehensions I was
meaning
On Jul 14, 2009, at 3:35 PM, William Stein wrote:
2009/7/14 Carlos Córdoba ccordob...@gmail.com:
Thanks John, I'd seen Python comprehensions before, but since I
was trying
to do all in a one-liner, I think I overlooked your elegant and
simple
solution. One comprehension at a time is
On Tue, Jul 14, 2009 at 3:01 AM, Paul Sargentpsa...@gmail.com wrote:
On 13 Jul 2009, at 17:13, Robert Bradshaw wrote:
In general, we try to avoid modifying the preparser as much as
possible. Sometimes, we really have to
sage: eval(1/2 + 3^2)
1
is really not acceptable (IMHO) for a
Sorry for not answering before, I've being a bit busy. I'll try to give a
concrete example of what I'm trying to do so you can understand me better.
I have a list of real numbers, for example
[1,2,3]
I want to multiply by 2 to get
[2,4,6]
the to sum it to 3
[5,7,9]
then divide by the max
On Jul 14, 1:52 pm, Carlos Córdoba ccordob...@gmail.com wrote:
Sorry for not answering before, I've being a bit busy. I'll try to give a
concrete example of what I'm trying to do so you can understand me better.
I have a list of real numbers, for example
[1,2,3]
Python list comprehensions
Thanks John, I'd seen Python comprehensions before, but since I was trying
to do all in a one-liner, I think I overlooked your elegant and simple
solution. One comprehension at a time is quite neat, but several is just
unreadable.
On Tue, Jul 14, 2009 at 4:28 PM, John H Palmieri
2009/7/14 Carlos Córdoba ccordob...@gmail.com:
Thanks John, I'd seen Python comprehensions before, but since I was trying
to do all in a one-liner, I think I overlooked your elegant and simple
solution. One comprehension at a time is quite neat, but several is just
unreadable.
That could be
On Jul 14, 3:35 pm, William Stein wst...@gmail.com wrote:
2009/7/14 Carlos Córdoba ccordob...@gmail.com:
Thanks John, I'd seen Python comprehensions before, but since I was trying
to do all in a one-liner, I think I overlooked your elegant and simple
solution. One comprehension at a time
[ x ] No, I can read the above just fine. It is crystal clear.
... but of course unnecessarily verbose. In my opinion a more common
notation in Sage:
sage: x=2*vector(range(10))+vector(10*[3])
sage: list_plot(map(lambda a:[cos(a),sin(a)],x/max(x)))
is superior to Mathematica.
On Tue, Jul
[ x ] No, I can read the above just fine. It is crystal clear.
... but of course unnecessarily verbose. In my opinion a more common
notation in Sage:
sage: x=2*vector(range(10))+vector(10*[3])
sage: list_plot(map(lambda a:[cos(a),sin(a)],x/max(x)))
is superior to Mathematica.
On Tue, Jul
On Jul 12, 9:05 pm, Carlos Córdoba ccordob...@gmail.com wrote:
Thanks for your quick answers. Coming from Mathematica, I was expecting to
add lists as vectors, multiply real numbers by lists, etc, without
sub-classing or using another types (such as vectors in sage)
just to clarify this,
On Jul 12, 2009, at 2:49 PM, Kevin Horton wrote:
Carlos Córdoba wrote:
Thanks for your quick answers. Coming from Mathematica, I was
expecting to
add lists as vectors, multiply real numbers by lists, etc, without
sub-classing or using another types (such as vectors in sage)
Sage lists
Thanks for your quick answers. Coming from Mathematica, I was expecting to
add lists as vectors, multiply real numbers by lists, etc, without
sub-classing or using another types (such as vectors in sage)
Do you advise me to add things to the preparser to have this behaviour or
not? If so, how can
Carlos Córdoba wrote:
Thanks for your quick answers. Coming from Mathematica, I was expecting to
add lists as vectors, multiply real numbers by lists, etc, without
sub-classing or using another types (such as vectors in sage)
Do you advise me to add things to the preparser to have this
21 matches
Mail list logo