|
Last change
on this file since 14206 was 12817, checked in by neise, 14 years ago |
|
added examples folder with some small scripts for mere testing
|
|
File size:
410 bytes
|
| Line | |
|---|
| 1 | #!/usr/bin/python
|
|---|
| 2 | #
|
|---|
| 3 | # Werner Lustermann
|
|---|
| 4 | # ETH Zurich
|
|---|
| 5 | #
|
|---|
| 6 | # test / example: save multiple arrays into a file
|
|---|
| 7 | #
|
|---|
| 8 | import numpy as np
|
|---|
| 9 |
|
|---|
| 10 | a = np.zeros( 10 )
|
|---|
| 11 | b = np.ones( (10, 3) )
|
|---|
| 12 |
|
|---|
| 13 | print 'a', a
|
|---|
| 14 | print 'b', b
|
|---|
| 15 |
|
|---|
| 16 | np.savez( 'save.npz', amplitude = a, time = b )
|
|---|
| 17 |
|
|---|
| 18 | f = np.load( 'save.npz' )
|
|---|
| 19 |
|
|---|
| 20 | print 'f.files'
|
|---|
| 21 | print f.files
|
|---|
| 22 |
|
|---|
| 23 | ampl = f['amplitude']
|
|---|
| 24 | time = f['time']
|
|---|
| 25 |
|
|---|
| 26 | print 'ampl', ampl
|
|---|
| 27 | print 'time', time
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.