[Numpy-discussion] deprecate numpy.matrix

josef.pktd at gmail.com josef.pktd at gmail.com
Mon Feb 10 15:04:17 EST 2014


On Mon, Feb 10, 2014 at 2:49 PM, Matthew Brett <matthew.brett at gmail.com>wrote:

> Hi,
>
> On Mon, Feb 10, 2014 at 11:44 AM,  <josef.pktd at gmail.com> wrote:
> >
> >
> > On Mon, Feb 10, 2014 at 2:12 PM, eat <e.antero.tammi at gmail.com> wrote:
> >>
> >>
> >>
> >>
> >> On Mon, Feb 10, 2014 at 9:08 PM, alex <argriffi at ncsu.edu> wrote:
> >>>
> >>> On Mon, Feb 10, 2014 at 2:03 PM, eat <e.antero.tammi at gmail.com> wrote:
> >>> > Rhetorical or not, but FWIW I'll prefer to take singular value
> >>> > decomposition
> >>> > (u, s, vt= svd(x)) and then based on the singular values s I'll
> >>> > estimate a
> >>> > "numerically feasible rank" r. Thus the diagonal of such hat matrix
> >>> > would be
> >>> > (u[:, :r]** 2).sum(1).
> >>>
> >>> It's a small detail but you probably want svd(x, full_matrices=False)
> >>> to avoid anything NxN.
> >>
> >> Indeed.
> >
> >
> > I meant the entire diagonal not the trace of the projection matrix.
> >
> > My (not articulated) thought was that I use element wise multiplication
> > together with dot products instead of the three dot products, however
> > elementwise algebra is not very common in linear algebra based textbooks.
> >
> > The question is whether students and new user coming from `matrix`
> languages
> > can translate formulas into code, or just copy formulas to code.
> > (It took me a while to get used to numpy and take advantage of it's
> features
> > coming from GAUSS and Matlab.)
> >
> > OT since the precense or absence of matrix in numpy doesn't affect me.
>
> Josef - as a data point - does statsmodels use np.matrix?
>

No (*). It's too much work to pay attention to whether something is an
array or a matrix.
although, we have a few sparse matrices.
and pandas.DataFrames have a few tricky corners in between array and matrix.

(*) grep findes two cases of `np.matrix` in the sandbox. (old unused code)

Josef


>
> Cheers,
>
> Matthew
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140210/95e78694/attachment.html>


More information about the NumPy-Discussion mailing list