So I was just using python's basemap for the first time recently and I had a script that worked on a large dataset of about 30,000 points just yesterday. When I came back today, it stopped working and started giving me value errors when I added a new dataset. I don't know what could be causing it but I'm getting a value error?
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-5-16fa79cd74a5> in <module>()
12 longitude = np.array(df[(df['FLOAT'] == x)]['LONGITUDE'])
13 latitude = np.array(df[df['FLOAT'] == x]['LATITUDE'])
---> 14 m.plot(longitude,latitude, latlon=True)
15 parallels = np.arange(-90.,90.,10.)
16
C:\Anaconda\lib\site-packages\mpl_toolkits\basemap\__init__.pyc in with_transform(self, x, y, *args, **kwargs)
534 if self.projection in _cylproj or self.projection in _pseudocyl:
535 if x.ndim == 1:
--> 536 x = self.shiftdata(x)
537 elif x.ndim == 0:
538 if x > 180:
C:\Anaconda\lib\site-packages\mpl_toolkits\basemap\__init__.pyc in shiftdata(self, lonsin, datain, lon_0)
4775 thresh = 360.-londiff_sort[-2]
4776 itemindex = len(lonsin)-np.where(londiff>=thresh)[0]
-> 4777 if itemindex:
4778 # check to see if cyclic (wraparound) point included
4779 # if so, remove it.
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Anyone have a clue? Maybe there's a data value in the array that doesn't work out right?
np.wherein line 4776 is returning an array where it should be returning a single value. What are the shapes of yourlongitudeandlatitudearrays?