matplotlib / matplotlib/basemap
support pandas Series as input for lat/lon -> x/y conversion
未关闭
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 817
- 派生
- 395
- PR 合并指标
- 30 天内没有已合并 PR
描述
Using pd.Series() as input for lat/long -> x/y conversion does currently raise a RuntimeError:
x,y = map_katins(df["lon"], df["lat"])
RuntimeError Traceback (most recent call last)
<ipython-input-139-693c51387321> in <module>()
15 # map_katins.plot(x, y, "ro", markersize=10)
16 x,y = map_katins(df["lon"].values, df["lat"].values)
---> 17 x,y = map_katins(df["lon"], df["lat"])
18 map_katins.plot(x, y, "o", color="grey", markersize=5)
19
C:\portabel\miniconda\envs\katins\lib\site-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:
C:\portabel\miniconda\envs\katins\lib\site-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']:
C:\portabel\miniconda\envs\katins\lib\site-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:
Using
x,y = map_katins(df["lon"].values, df["lat"].values)
works...
import mpl_toolkits.basemap
mpl_toolkits.basemap.__version__
'1.0.7'
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,使用提供的 Basemap 1.0.7 上下文,在入口点 map_katins(df["lon"], df["lat"]) 重现该故障,并将其与正常工作的 .values 调用进行比较。跟踪转换进入 Basemap 投影调用的过程,并确定现有回归测试的位置;当 pandas Series 输入能够在没有 RuntimeError 的情况下完成转换,同时现有数组输入继续正常工作时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- pandas, python
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100