[Numpy-discussion] Changing a matrix element into a scalar

Wayne Watson sierra_mtnview at sbcglobal.net
Tue Aug 3 12:23:40 EDT 2010


How do I access 1.2 in such a way as to end up with a float? I keep 
getting a matrix.
from numpy import matrix
m = matrix([[1.2],[2.3]])

-- 
            Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

              (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
               Obz Site:  39° 15' 7" N, 121° 2' 32" W, 2700 feet

              "Republicans are always complaining that government is
               out of control. If they get into power, they will
               prove it." -- R. J. Rourke


                     Web Page:<www.speckledwithstars.net/>




More information about the NumPy-Discussion mailing list