[Numpy-discussion] loadtxt ndmin option
Derek Homeier
derek at astro.physik.uni-goettingen.de
Wed May 4 20:54:36 EDT 2011
On 05.05.2011, at 2:40AM, Paul Anton Letnes wrote:
> But: Isn't the numpy.atleast_2d and numpy.atleast_1d functions written for this? Shouldn't we reuse them? Perhaps it's overkill, and perhaps it will reintroduce the 'transposed' problem?
Yes, good point, one could replace the
X.shape = (X.size, ) with X = np.atleast_1d(X),
but for the ndmin=2 case, we'd need to replace
X.shape = (X.size, 1) with X = np.atleast_2d(X).T -
not sure which solution is more efficient in terms of memory access etc...
Cheers,
Derek
More information about the NumPy-Discussion
mailing list