From: Charles R H. <cha...@gm...> - 2006-09-05 17:17:11
|
On 9/5/06, Charles R Harris <cha...@gm...> wrote: > > I am trying to write more document strings for numpy and have a question > about the order keyword in tostring. The usual allowed values of this > keyword are "C", "F", or None, but in the tostring method there is also the > value "Any" which has the same effect as None. I wonder if the "Any" > shouldn't be removed as None seems to be the preferred form in other > methods. Also, the default value of order in the tostring method is "C" and > it seems to me that the principal of least surprise requires None as the > default so that the order of the array being converted is the default. > > Chuck > > What is the actual order of data in memory? Is it always row major? In [38]: array([[1,2],[3,4]], dtype=int8, order="F").tofile('test.txt', sep=" ") In [39]: cat test.txt 1 2 3 4 In [40]: array([[1,2],[3,4]], dtype=int8, order="F").tostring(order="A") Out[40]: '\x01\x03\x02\x04' |