title: Griddata : ValueError: data type <type 'numpy.int64'> not inexact or ValueError : shape mismatch
body: <p>I have a list <code>bathy</code> of 1,023,835 points. Each point is a list of coordinates x and y and a height z.
  I have: <code>max(x)= 9940</code> and <code>max(y)= 6445</code>
  I want to interpolate the latter with either mlab or scipy.interpolate</p>
  
  <p>So I try different codes. Them and their respective errors :</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  import scipy.interpolate as si
  import matplotlib.mlab as ml
  
  # grid the data.
  x,y,z = zip(*bathy) 
  xi = np.arange(0,max(x))
  yi = np.arange(0,max(y))
  
  zi = ml.griddata(x, y, z, xi, yi, interp='linear')  #griddata from mlab
  #zi = si.griddata((x, y),z, (xi, yi), method='linear',fill_value=0) #griddata from scipy.intperlate
  fig = plt.figure()
  
  plt.scatter(y, x, color='g', marker='o', alpha=0.5)
  plt.colorbar
  plt.show()
  </code></pre>
  
  <hr>
  
  <pre><code>ValueError                                Traceback (most recent call last)
  &lt;ipython-input-78-65f44ae4c4b5&gt; in &lt;module&gt;()
        4 
        5 
  ----&gt; 6 zi = ml.griddata(x, y, z, xi, yi, interp='linear')  #griddata from mlab
        7 #zi = si.griddata((x, y),z, (xi, yi), method='linear',fill_value=0)                     #griddata from scipy.intperlate
        8 fig = plt.figure()
  
  /usr/lib/pymodules/python2.7/matplotlib/mlab.pyc in griddata(x, y, z, xi, yi, interp)
     2777             dx = xi[0,1:]-xi[0,0:-1]
     2778             dy = yi[1:,0]-yi[0:-1,0]
  -&gt; 2779             epsx = np.finfo(xi.dtype).resolution
     2780             epsy = np.finfo(yi.dtype).resolution
     2781             if dx.max()-dx.min() &gt; epsx or dy.max()-dy.min() &gt; epsy:
  
  /usr/lib/pymodules/python2.7/numpy/core/getlimits.pyc in __new__(cls, dtype)
      105             dtype = newdtype
      106         if not issubclass(dtype, numeric.inexact):
  --&gt; 107             raise ValueError, "data type %r not inexact" % (dtype)
      108         obj = cls._finfo_cache.get(dtype,None)
      109         if obj is not None:
  
  ValueError: data type &lt;type 'numpy.int64'&gt; not inexact
  </code></pre>
  
  <p>The second is nearly the same but since I use griddata from scipy, it may be useful :</p>
  
  <pre><code># grid the data.
  x,y,z = zip(*bathy) 
  xi = np.arange(0,max(x))
  yi = np.arange(0,max(y))
  
  
  #zi = ml.griddata(x, y, z, xi, yi, interp='linear') #griddata from mlab
  zi = si.griddata((x, y),z, (xi, yi), method='linear',fill_value=0)          #griddata from scipy.intperlate
  
  fig = plt.figure()
  plt.scatter(y,x,color='g',marker='o', alpha=0.5)
  plt.colorbar
  plt.show()
  </code></pre>
  
  <hr>
  
  <pre><code>ValueError                                Traceback (most recent call last)
  &lt;ipython-input-73-8936d8734f97&gt; in &lt;module&gt;()
        5 
        6 #zi = ml.griddata(x, y, z, xi, yi, interp='linear')                                                                #griddata from mlab
  ----&gt; 7 zi = si.griddata((x, y),z, (xi, yi), method='linear',fill_value=0)                      #griddata from scipy
        8 fig = plt.figure()
        9 #ax = fig.add_subplot(111, projection='3d')
  
  /usr/lib/python2.7/dist-packages/scipy/interpolate/ndgriddata.pyc in griddata(points, values, xi, method, fill_value)
      182     elif method == 'linear':
      183         ip = LinearNDInterpolator(points, values, fill_value=fill_value)
  --&gt; 184         return ip(xi)
      185     elif method == 'cubic' and ndim == 2:
      186         ip = CloughTocher2DInterpolator(points, values, fill_value=fill_value)
  
  /usr/lib/python2.7/dist-packages/scipy/interpolate/interpnd.so in scipy.interpolate.interpnd.NDInterpolatorBase.__call__ (scipy/interpolate/interpnd.c:1968)()
  
  /usr/lib/python2.7/dist-packages/scipy/interpolate/interpnd.so in scipy.interpolate.interpnd._ndim_coords_from_arrays (scipy/interpolate/interpnd.c:2221)()
  
  /usr/lib/pymodules/python2.7/numpy/lib/stride_tricks.pyc in broadcast_arrays(*args)
       92             # There must be at least two non-1 lengths for this axis.
       93             raise ValueError("shape mismatch: two or more arrays have "
  ---&gt; 94                 "incompatible dimensions on axis %r." % (axis,))
       95         elif len(unique) == 2:
       96             # There is exactly one non-1 length. The common shape will take this
  
  ValueError: shape mismatch: two or more arrays have incompatible dimensions on axis 0.
  </code></pre>
  
  <p>Thanks</p>