lannybroo / numpyIO
Implementation of scipy.io.numpyio.fread and scipy.io.numpyio.fwrite without depending on scipy. Uses numpy's tofile/fromfile instead.
Clone this repository (size: 28.0 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/lannybroo/numpyio/
| commit 11: | b4d9a3dcc547 |
| parent 10: | 4df4672536ec |
| branch: | default |
Do byteswap in place for fread().
Changed (Δ1 byte):
raw changeset »
numpyIO.py (2 lines added, 2 lines removed)
| … | … | @@ -79,7 +79,7 @@ OPTIONAL |
79 |
79 |
|
80 |
80 |
# adjust for byteswap & mem_type |
81 |
81 |
if byteswap: |
82 |
a1 |
|
82 |
a1.byteswap(True) |
|
83 |
83 |
if read_type!=mem_type: |
84 |
84 |
a1 = a1.astype(mem_type) |
85 |
85 |
|
| … | … | @@ -182,7 +182,7 @@ def _testFreadFwrite(): |
182 |
182 |
import time |
183 |
183 |
|
184 |
184 |
#a = numpy.array([1.0, 1.1, 1.2]).astype('d') |
185 |
n = |
|
185 |
n = 20e6 #10e5 10e6 |
|
186 |
186 |
a = 127*(numpy.random.random_sample(n)-0.5) |
187 |
187 |
fn = 'temp.bin' |
188 |
188 |
dt = [] |
