[sage-support] Re: python's list comprehension

2009-03-22 Thread John Cremona
Perhaps the Sage version of the database should have the rounded analytic Sha values and not the floating point ones (for positive rank curves, I mean: in the rank 0 case the values are already integers). Nils, if you get the files

[sage-support] Re: python's list comprehension

2009-03-21 Thread Carl Witty
On Mar 20, 5:52 pm, Nils Bruin nbr...@sfu.ca wrote: sage: DB = CremonaDatabase() sage: L = [ N.str()+c[0] for N in (lambda l: xrange(l[0],l[1])) (DB.conductor_range()) for c in DB.allbsd(N).items() if                  round(RDF(c[1][4]))%81 == 0] ...  - the whole lambda expression to make

[sage-support] Re: python's list comprehension

2009-03-21 Thread William Stein
On Sat, Mar 21, 2009 at 5:24 PM, Carl Witty carl.wi...@gmail.com wrote: On Mar 20, 5:52 pm, Nils Bruin nbr...@sfu.ca wrote: sage: DB = CremonaDatabase() sage: L = [ N.str()+c[0] for N in (lambda l: xrange(l[0],l[1])) (DB.conductor_range()) for c in DB.allbsd(N).items() if                  

[sage-support] Re: python's list comprehension

2009-03-21 Thread Craig Citro
Note that you're skipping the last conductor in the database, I think... DB.conductor_range? indicates that the returned values represent an inclusive range, but range/xrange/etc. take their second argument as an exclusive bound.  (This is easy to fix with the above xrange expression, but I

[sage-support] Re: python's list comprehension

2009-03-20 Thread Craig Citro
Hi Nils, Yep, I think there are ways of making this nicer. I was interested in elliptic curves with possible 9-torsion in Sha, so I figured querying Cremona's database would get me some examples. After some experimenting, I finally created a query that had the desired result: sage: DB =

[sage-support] Re: python's list comprehension

2009-03-20 Thread N. Bruin
Thanks Craig, The '*arg' notation is exactly what I was looking for. My confidence in Guido and the sage API designers is restored. --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email