Sto lavorando con numpy, ho creato una struttura che contiene alcuni dati, ma quando tento di salvare l'array usando la funzione np.savetxt ottengo un errore per me poco comprensibile. Riporto un pezzo di codice e l'errore:
irt = [('x', float), ('y', float), ('size', float)] dt = np.dtype([('time', int), ('acc', [('x', float), ('y', float), ('z', float)]), ('ir', [('ir0', irt), ('ir1', irt), ('ir2', irt), ('ir3', irt)]), ]) data = [(0, (1, 2, 3), ((10, 20, 30),(10, 20, 30),(10, 20, 30),(10, 20, 30))), (1, (3, 4, 5), ((30, 40, 50),(30, 40, 50),(30, 40, 50),(30, 40, 50))), (2, (5, 6, 7), ((50, 60, 70),(50, 60, 70),(50, 60, 70),(50, 60, 70))), (3, (7, 8, 9), ((70, 80, 90),(70, 80, 90),(70, 80, 90),(70, 80, 90)))] arraydata = np.array(data, dtype=dt) np.savetxt('testa.txt', arraydata) Traceback (most recent call last): File ".../dtype.py", line 118, in <module> np.savetxt('testa.txt', arraydata) File "/usr/lib/pymodules/python2.7/numpy/lib/npyio.py", line 886, in savetxt fh.write(asbytes(format % tuple(row) + newline)) TypeError: float argument required, not numpy.void Qualcuno saprebbe darmi qualche indicazione? Grazie -- Daniele www.fugamatematica.blogspot.com giusto! nel verso forse è perché non guardiamo le cose Quando non ci capiamo, _______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python