Thanks, but then - how do I map "int" to all elements of my matrix M?
The command

sage: map(int,M)

also returns a TypeError.  There's nothing wrong with the individual
elements of M, as "int(M[0,0])" works fine.

cheers,
Alasdair


On Oct 24, 6:19 pm, Nils Bruin <[email protected]> wrote:
> On Oct 23, 4:40 am, Alasdair <[email protected]> wrote:
>
> > Here is an example:
>
> > sage: G.<x>=GF(2^8)
> > sage: M=random_matrix(G,2,2)
> > sage: map(int,M.row(0))
> > [152, 58]
> > sage: map_threaded(int,M)
> > TypeError: base_ring (=<type 'int'>) must be a ring
>
> > Why won't map_threaded work where map does?
>
> Note that the second arguments in the statements above are different.
> Both map and map_threaded succeed and fail on the same inputs, but
> with different return types and different error messages.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to