From: Mike E. <mik...@gm...> - 2005-04-25 21:16:25
|
Hello Jeff, I tried loading the file etopo20.pickle by itself but got the same error: import cPickle a =3D cPickle.load(open('etopo20.pickle','rb')) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.3/site-packages/numarray/generic.py", line 159, in Cla\ssicUnpickler self.__setstate__(state) File "/usr/lib/python2.3/site-packages/numarray/numarraycore.py", line 463, i\n __setstate__ self._type =3D state["_type"] AttributeError: ("'str' object has no attribute 'name'", <function ClassicUnpic\kler at 0xb71e48b4>, (<class 'numarray.numarraycore.NumArray'>, {'_type': 'Floa\t32', '_itemsize': 4, '_shape': (1081,), '_bytestride': 4, '_byteoffset': 0, '_\version': '1.1', '_byteorder': 'big', '_data': <memory at 082ee9a0 with size:43\24 held by object 082ee980 aliasing object 00000000>, '_strides': (4,)})) Looking at etopo20.pickle itself, the 4th line reads 'cnumarray.generic' - I'm guessing that means it is stored using numarray. Do I need a specific version of python or numarray to read it? I have both Numeric (23.1) and numarray installed already. Mike. On 4/25/05, Jeff Whitaker <js...@fa...> wrote: > Mike Elson wrote: >=20 > >I'm having trouble running some of the examples that come with basemap > >- any th\at use the file etopo20.pickle fail with an error similar to: > > > >Traceback (most recent call last): > > File "test.py", line 12, in ? > > topodict =3D cPickle.load(open('etopo20.pickle','rb')) > > File "/usr/lib/python2.3/site-packages/numarray/generic.py", line > >159, in Cla\ssicUnpickler > > self.__setstate__(state) > > File "/usr/lib/python2.3/site-packages/numarray/numarraycore.py", > >line 463, i\n __setstate__ > > self._type =3D state["_type"] > >AttributeError: ("'str' object has no attribute 'name'", <function > >ClassicUnpic\kler at 0xb7b08e9c>, (<class > >'numarray.numarraycore.NumArray'>, {'_type': 'Floa\t32', '_itemsize': > >4, '_shape': (1081,), '_bytestride': 4, '_byteoffset': 0, '_\version': > >'1.1', '_byteorder': 'big', '_data': <memory at 082f8798 with > >size:43\24 held by object 082f8778 aliasing object 00000000>, > >'_strides': (4,)})) > > > >Can anyone tell me how to fix this? > >I'm using python 2.3.4, matplotlib 0.80, basemap 0.3.2, proj 4.4.8 and > >have the Python libraries numeric 23.1 and numarray 0.8 installed. > > > >Thanks in advance, > >Mike. > > > > > > > Mike: My guess is I saved the data as a pickle Numeric (not numarray) ob= ject. You can either install Numeric, or I can re-pickle it for you with n= umarray. >=20 > -Jeff >=20 > --- > Jeffrey S. Whitaker Phone : (303)497-6313 > NOAA/OAR/CDC R/CDC1 FAX : (303)497-6449 > 325 Broadway Web : http://www.cdc.noaa.gov/~jsw > Boulder, CO, USA 80305-3328 Office: Skaggs Research Cntr 1D-124 >=20 > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |