title: RuntimeWarning: Invalid value encountered in less xa[xa < 0] = -1 (Geopandas)
body: <h3>Problem</h3>
  
  <p>I'm trying to plot crime data in each district using <strong>geopandas</strong>. I have merged <code>shapefile</code> data and crime data:</p>
  
  <pre><code>merged = merged[['geometry','Extortion']]
  merged.head()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/MILS3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MILS3.jpg" alt="merged data"></a></p>
  
  <h3>Attempt</h3>
  
  <p>Then, I tried to plot crime data on top of the map:</p>
  
  <pre><code>variable = 'Extortion'
  vmin, vmax = 120, 220
  fig, ax = plt.subplots(1, figsize=(20, 10))
  merged.plot(variable, cmap='Blues', linewidth=0.8, ax=ax, edgecolor='0.8')
  </code></pre>
  
  <h3>Error</h3>
  
  <pre><code>C:\Users\Navoda\Anaconda3\lib\site-packages\matplotlib\colors.py:504: 
  RuntimeWarning: invalid value encountered in less
  xa[xa &lt; 0] = -1
  </code></pre>
  
  <p>Without the parameter 'variable', it loads to the base map. The problem is with the variable. I tried switching off warnings as most of the posts suggested. It still didn't load crime data. </p>
  
  <p>I checked the error location. But, I couldn't figure out the reason.</p>
  
  <h3>Code</h3>
  
  <pre><code>if xa.dtype.kind == "f":
          xa *= self.N
          # Negative values are out of range, but astype(int) would truncate
          # them towards zero.
          xa[xa &lt; 0] = -1
          # xa == 1 (== N after multiplication) is not out of range.
          xa[xa == self.N] = self.N - 1
          # Avoid converting large positive values to negative integers.
          np.clip(xa, -1, self.N, out=xa)
          xa = xa.astype(int)
  </code></pre>
  
  <p>Note: Extortion column does not have <code>NaN</code> values.</p>
  
  <p>How do I solve this problem? </p>