Hoi,
1.) Nein, hast Du nicht: dtype legt den "minimalen" Datentyp Deines Arrays fest.
Beispiel:
Code: Alles auswählen
a = arange(10,dtype='<i2') #array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=int16)
b = arange(10) #array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
c = arange(10,dtype='i2') #array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=int16)
Eine Erklärung magst Du
hier finden.
2.) Einen Link kenne ich nicht, aber ein
Beispiel.
Und den Docstring:
Code: Alles auswählen
>>> print numpy.fromfile.__doc__
fromfile(file=, dtype=int, count=-1, sep='')
Return an array of the given data type from a
(text or binary) file. The file argument can be an open file
or a string with the name of a file to read from. If
count==-1, then the entire file is read, otherwise count is
the number of items of the given type read in. If sep is ''
then read a binary file, otherwise it gives the separator
between elements in a text file.
WARNING: This function should be used sparingly, as it is not
a platform-independent method of persistence. But it can be
useful to read in simply-formatted or binary data quickly.
3.) Nicht implizit. Aber Du kannst Deine eigene Funktion schreiben, die den Header überspring. (fromfile akzeptiert als input ja nicht nur einen Dateinamen, sondern auch das geöffnete File.)
Außerdem: Kennst Du
PyTables. Das baucht zwar z. Zt. noch auf numarray auf, wird aber in absehbarer Zeit auf numpy umstellen und die Konvertierung von numarray zu numpy arrays ist ja leicht.
Funktioniert denn jetzt das Einlesen Deines ursprünglichen Files?
Gruß,
Christian