You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Multi-dimensionial array support for savetxt / loadtxt (Trac #1888) #2481
I think it would be feasible to support multi-dimensional saving/loading quite simply by using multiple line-breaks for 'higher-dimensional' linebreaks.
To some degree this has already been addressed in #1705. I am in favour of adopting the gnuplot convention of double blank lines between blocks, as there seems to be some demand for reading in files of this style. I don't feel quite comfortable with the way proposed in the patch there to return a regular ndarray(N,M) plus an index list to the blocks though.
As a general comment, basic support for such functionality would indeed be relatively easy to implement, but there are a few design decisions involved (like the above, or should we allow to read data blocks of different sizes or only true 3-dimensional arrays, meaning to raise an error if not all of the blocks have equal length...); and it touches a number of features that have just been cleared up in the code - e.g. the ndmin keyword and the behaviour of the unpack option for regular vs. record arrays. Not sure of the latter can be consistently defined for arbitrary dimensions.
Activity
numpy-gitbot commentedon Oct 23, 2012
@dhomeier wrote on 2011-07-04
To some degree this has already been addressed in #1705. I am in favour of adopting the gnuplot convention of double blank lines between blocks, as there seems to be some demand for reading in files of this style. I don't feel quite comfortable with the way proposed in the patch there to return a regular ndarray(N,M) plus an index list to the blocks though.
As a general comment, basic support for such functionality would indeed be relatively easy to implement, but there are a few design decisions involved (like the above, or should we allow to read data blocks of different sizes or only true 3-dimensional arrays, meaning to raise an error if not all of the blocks have equal length...); and it touches a number of features that have just been cleared up in the code - e.g. the ndmin keyword and the behaviour of the unpack option for regular vs. record arrays. Not sure of the latter can be consistently defined for arbitrary dimensions.
numpy-gitbot commentedon Oct 23, 2012
Milestone changed to
NumPy 2.0by @dhomeier on 2011-07-04