On Thu, Oct 20, 2011 at 10:08 AM, Mathieu Blondel <[email protected]> wrote: > On Thu, Oct 20, 2011 at 10:41 PM, Virgile Fritsch > <[email protected]> wrote: >> In both cases, we would need to write some more lines of code to deal with a >> np.matrix input (whether it is for converting it or rejecting it, we need to >> test the object type). The code will be a bit more complex whatever the >> adopted solution is, therefore I vote for "converting" since at least the >> end user will appreciate this functionality. > > Will converting the matrix imply that the data exists twice in memory > at some point? Doing things behind the scene is not so nice, so I'd > prefer to raise an exception to force the user to change his/her > user-land code.
No, np.asarray is standard if you need an array and it does not copy for subtypes >>> a = np.matrix(np.random.randn(3,4)) >>> b = np.asarray(a) >>> b.flags OWNDATA : False Josef > > Mathieu > > ------------------------------------------------------------------------------ > The demand for IT networking professionals continues to grow, and the > demand for specialized networking skills is growing even more rapidly. > Take a complimentary Learning@Ciosco Self-Assessment and learn > about Cisco certifications, training, and career opportunities. > http://p.sf.net/sfu/cisco-dev2dev > _______________________________________________ > Scikit-learn-general mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/scikit-learn-general > ------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Ciosco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev _______________________________________________ Scikit-learn-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
