1 May 04:11
problem referencing single element arrays
Alan Jackson <alan <at> ajackson.org>
2008-05-01 02:11:52 GMT
2008-05-01 02:11:52 GMT
Having a problem with numpy that has me stumped. I have a large set of arrays. I want to set up cross reference lists of elements within those arrays, with the lists just being pointers to the objects (floating point numbers) stored in the arrays. The problem is that some arrays have only a single element, so when I try to store a[0] for a single element array, I get an error, "0-d arrays can't be indexed". How do I get a pointer to the object stored and not the array for single element arrays? Or maybe I don't want to be doing this? -- -- ----------------------------------------------------------------------- | Alan K. Jackson | To see a World in a Grain of Sand | | alan <at> ajackson.org | 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 | -----------------------------------------------------------------------
RSS Feed