[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 http://www.warwick.ac.uk/staff/J.E.Cremona/ftp/data/allbigsha.*.

[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, bu

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

2009-03-21 Thread William Stein
On Sat, Mar 21, 2009 at 5:24 PM, Carl Witty wrote: > > On Mar 20, 5:52 pm, Nils Bruin 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 ==

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

2009-03-21 Thread Carl Witty
On Mar 20, 5:52 pm, Nils Bruin 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 the pair ou

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

2009-03-20 Thread William Stein
On Fri, Mar 20, 2009 at 10:20 PM, N. Bruin wrote: > > Thanks Craig, > > The '*arg' notation is exactly what I was looking for. My confidence > in Guido and the sage API designers is restored. There is also a **kwds's notation, which you should learn about. If you have a function foo that takes

[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 t

[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: D