Actually, just worked it out:

matrix(ZZ,2,2,map(int,M.list()))

So I need to convert the matrix to a list, apply map to that list, and
then convert the result back to a matrix.  But why can't I do this
with a single map command?

-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