I been beating myself up over this bit of code for far too long now - I
know I must be missing something really simple, but what is it?
TYPICALLY_UINT_COLUMNS = ['Track', 'Bin', 'code', 'horizon']
......
dtypes = [ ]
for i in range(0, len(self.var_list)) :
if TYPICALLY_UINT_COLUMNS.count(self.var_list[i]) > 0:
dtypes.append((self.var_list[i], '<i8'))
else :
dtypes.append((self.var_list[i], '<f8'))
print "dtypes = ", dtypes
print outdata[0]
outdata = np.array(outdata, dtype=dtypes)
dtypes = [('Track', '<i8'), ('Bin', '<i8'), ('Depth', '<f8'), ('extrema',
'<f8'), ('code', '<i8'), ('horizon', '<i8')]
(345, 615, 4826.0, 470.588012695, 47, 636)
Exception occurred in traits notification handler.
Please check the log file for details.
Exception occurred in traits notification handler for object:
<__main__.MaplEdit object at 0x8bb54dc>, trait: Run, old value: <undefined>,
new value: 0
Traceback (most recent call last):
File
"/usr/local/lib/python2.5/site-packages/enthought.traits-2.0.4-py2.5-linux-i686.egg/enthought/traits/trait_notifiers.py",
line 325, in call_1
self.handler( object )
File "TrimMapl_1.py", line 98, in _Run_fired
outdata = np.array(outdata, dtype=dtypes)
TypeError: expected a readable buffer object
Thanks,
Alan
--
-----------------------------------------------------------------------
| Alan K. Jackson | To see a World in a Grain of Sand |
| [EMAIL PROTECTED] | And a Heaven in a Wild Flower, |
| www.ajackson.org | Hold Infinity in the palm of your hand |
| Houston, Texas | And Eternity in an hour. - Blake |
-----------------------------------------------------------------------
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion