source: fact/tools/pyscripts/examples/test_save.py@ 13420

Last change on this file since 13420 was 12817, checked in by neise, 13 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#
8import numpy as np
9
10a = np.zeros( 10 )
11b = np.ones( (10, 3) )
12
13print 'a', a
14print 'b', b
15
16np.savez( 'save.npz', amplitude = a, time = b )
17
18f = np.load( 'save.npz' )
19
20print 'f.files'
21print f.files
22
23ampl = f['amplitude']
24time = f['time']
25
26print 'ampl', ampl
27print 'time', time
Note: See TracBrowser for help on using the repository browser.