support pandas Series as input for lat/lon -> x/y conversion
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- pandas, python
- Domain
- data-visualization
Research direction
Start by reproducing the failure at the map_katins(df["lon"], df["lat"]) entry point and compare it with the working .values calls, using the Basemap 1.0.7 context provided. Trace the conversion into the Basemap projection call and identify the existing regression-test location; done means pandas Series inputs convert without the RuntimeError while existing array inputs continue to work.
Written by the indexing model from the issue text.
Description
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'
- Dominant language
- Python
- Stars
- 817
- Forks
- 395
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from matplotlib/basemap
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
matplotlib/basemap#368 ·
-
Python 3.14 wheels Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
matplotlib/basemap#652 · 2 comments · 5 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
matplotlib/basemap#649 · 2 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
matplotlib/basemap#646 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
matplotlib/basemap#645 · 2 comments ·
All issues in matplotlib/basemap
Similar issues
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DiamondLightSource/dodal#2211 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openml/openml-python#1749 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sipyourdrink-ltd/bernstein#6191 ·