问题描述
- python数据分析时出现RunTimeError
-
我在做《Python fo Data Analysis》第8章地震危机数据处理的时候出现了以下错误信息,希望有大神帮忙分析一下。RuntimeError Traceback (most recent call last) <ipython-input-15-b85854eb74f4> in <module>() 80 cat_data = data[data['category_%s' % code] == 1] 81 ---> 82 x, y = m(cat_data.LONGITUDE, cat_data.LATITUDE) 83 84 m.plot(x, y, 'k.', alpha=0.5) /usr/local/lib/python2.7/dist-packages/mpl_toolkits/basemap/__init__.pyc in __call__(self, x, y, inverse) 1146 except TypeError: 1147 y = [_dg2rad*yy for yy in y] -> 1148 xout,yout = self.projtran(x,y,inverse=inverse) 1149 if self.celestial and inverse: 1150 try: /usr/local/lib/python2.7/dist-packages/mpl_toolkits/basemap/proj.pyc in __call__(self, *args, **kw) 284 outxy = self._proj4(xy, inverse=inverse) 285 else: --> 286 outx,outy = self._proj4(x, y, inverse=inverse) 287 if inverse: 288 if self.projection in ['merc','mill','gall']: /usr/local/lib/python2.7/dist-packages/mpl_toolkits/basemap/pyproj.pyc in __call__(self, *args, **kw) 386 _proj.Proj._inv(self, inx, iny, radians=radians, errcheck=errcheck) 387 else: --> 388 _proj.Proj._fwd(self, inx, iny, radians=radians, errcheck=errcheck) 389 # if inputs were lists, tuples or floats, convert back. 390 outx = _convertback(xisfloat,xislist,xistuple,inx) _proj.pyx in _proj.Proj._fwd (src/_proj.c:1571)() RuntimeError:
解决方案
解决方案二:
只是提示了运行时错误 但是要看具体错误消息 不然不好分析 还可以代码中print增加一些输出
时间: 2025-01-31 01:40:07