New in version 1.0.
Opens, reads, and writes file objects in GAL format.
Examples
>>> import tempfile, pysal, os
>>> w = pysal.open('../../examples/sids2.gal','r').read()
>>> f = tempfile.NamedTemporaryFile(suffix='.gal')
>>> fname = f.name
>>> f.close()
>>> o = pysal.open(fname,'w')
>>> o.write(w)
>>> o.close()
>>> wnew = pysal.open(fname,'r').read()
>>> wnew.pct_nonzero == w.pct_nonzero
True
>>> os.remove(fname)
Methods
| by_row | |
| cast | |
| check | |
| close | |
| flush | |
| get | |
| getType | |
| next | |
| open | |
| read | |
| seek | |
| tell | |
| truncate | |
| write |
| Parameters: | .write(weightsObject) : accepts a weights object : Returns : —— : a GAL file : write a weights object to the opened GAL file. : |
|---|