title: How to fix "ValueError: Some errors were detected" while making contour plot in python?
body: <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  #from matplotlib.colors import LogNorm                                                                                                                                                        
  data = np.genfromtxt('test.txt', delimiter=' ')
  #print(data)                                                                                                                                                                                  
  lats =  data[:,0]
  ## lon =&gt; x                                                                                                                                                                                   
  lons =  data[:,1]
  ## values =&gt; z                                                                                                                                                                                
  values = data[:,2]
  ###                                                                                                                                                                                           
  #get unique lat lon values and their index positions                                                                                                                                         
                                                                                                                                                                                                
  lat_uniq, lat_idx = np.unique(lats, return_inverse=True)
  lon_uniq, lon_idx = np.unique(lons, return_inverse=True)
  
  #create 2D array necessary for the contour plot                                                                                                                                               
  xre, yre = np.meshgrid(lon_uniq, lat_uniq)
  zre = np.full(xre.shape, np.nan)
  #or if you know the standard value of the array, fill it with that                                                                                                                            
  #zre = np.full(xre.shape, 0)                                                                                                                                                                  
  zre[lat_idx, lon_idx] = values
  print(zre)
  
  cp1 = ax1.contourf(xre, yre, zre, levels=4)
  plt.colorbar(cp1, ax=ax1)
  ax1.set_title(&quot;data are not interpolated&quot;)                                                                                                                                                       
  plt.show()      
  </code></pre>
  <p>I'm using above code to make contour plot using the following data file:</p>
  <pre><code>  0.131093e+02  0.177896e+03 -0.40414e+00
    0.131093e+02  0.175171e+03  0.13945e+00
    0.131093e+02  0.172430e+03 -0.30306e+00
    0.131093e+02  0.169686e+03 -0.55408e+00
    0.131093e+02  0.166939e+03 -0.83886e+00
    0.131093e+02  0.164193e+03 -0.86370e+00
    0.131093e+02  0.161445e+03 -0.80324e+00
    0.131093e+02  0.158698e+03 -0.90610e+00
    0.131093e+02  0.155950e+03 -0.88049e+00
    0.131093e+02  0.153203e+03 -0.67812e+00
    0.131093e+02  0.150455e+03 -0.12274e+01
    0.131093e+02  0.147707e+03 -0.45769e+00
    0.131093e+02  0.144959e+03 -0.18481e+00
    0.131093e+02  0.142212e+03 -0.40263e+00
    0.131093e+02  0.139464e+03 -0.28334e+00
    0.131093e+02  0.136716e+03 -0.74765e+00
    0.131093e+02  0.133968e+03 -0.12686e+01
    0.131093e+02  0.131220e+03 -0.12086e+01
    0.131093e+02  0.128472e+03 -0.12217e+01
    0.131093e+02  0.125724e+03 -0.14198e+01
    0.131093e+02  0.122976e+03 -0.12149e+01
    0.131093e+02  0.120228e+03 -0.12164e+01
    0.131093e+02  0.117480e+03 -0.15441e+01
    0.131093e+02  0.114732e+03 -0.16276e+01
    0.131093e+02  0.111984e+03 -0.16502e+01
    0.131093e+02  0.109236e+03 -0.16112e+01
    0.131093e+02  0.106488e+03 -0.17506e+01
    0.131093e+02  0.103740e+03 -0.22230e+01
    0.131093e+02  0.100992e+03 -0.32516e+01
    0.131093e+02  0.982440e+02 -0.43111e+01
    0.131093e+02  0.954960e+02 -0.57498e+01
    0.131093e+02  0.927480e+02 -0.68310e+01
    0.131093e+02  0.900000e+02 -0.76633e+01
    0.131093e+02  0.872520e+02 -0.72959e+01
    0.131093e+02  0.845040e+02 -0.60899e+01
    0.131093e+02  0.817560e+02 -0.40353e+01
    0.131093e+02  0.790080e+02 -0.20282e+01
    0.131093e+02  0.762600e+02 -0.89988e+00
    0.131093e+02  0.735119e+02  0.89620e-02
    0.131093e+02  0.707639e+02  0.15540e+01
    0.131093e+02  0.680159e+02  0.31195e+01
    0.131093e+02  0.652679e+02  0.39587e+01
    0.131093e+02  0.625200e+02  0.41664e+01
    0.131093e+02  0.597720e+02  0.49690e+01
    0.131093e+02  0.570240e+02  0.61359e+01
    0.131093e+02  0.542760e+02  0.64248e+01
    0.131093e+02  0.515280e+02  0.50134e+01
    0.131093e+02  0.487801e+02  0.41975e+01
    0.131093e+02  0.460321e+02  0.27766e+01
    0.131093e+02  0.432842e+02  0.10263e+01
    0.131093e+02  0.405363e+02  0.18944e+01
    0.131093e+02  0.377884e+02  0.18444e+01
    0.131093e+02  0.350405e+02  0.20752e+01
    0.131093e+02  0.322927e+02  0.20572e+01
    0.131093e+02  0.295449e+02  0.29096e+01
    0.131093e+02  0.267972e+02  0.78921e+00
    0.131093e+02  0.240495e+02 -0.56208e+00
    0.131093e+02  0.213020e+02 -0.38200e+00
    0.131093e+02  0.185546e+02 -0.52279e+00
    0.131093e+02  0.158074e+02 -0.72196e+00
    0.131093e+02  0.130606e+02 -0.60089e+00
    0.131093e+02  0.103145e+02 -0.47480e+00
    0.131093e+02  0.756973e+01 -0.38686e+00
    0.131093e+02  0.482861e+01  0.43440e-01
    0.131093e+02  0.210359e+01  0.14024e+00
    0.131133e+02  0.177896e+03 -0.26623e+03
    0.131133e+02  0.175171e+03  0.19040e+03
    0.131133e+02  0.172430e+03 -0.41560e+03
    0.131133e+02  0.169686e+03  0.19715e+03
    0.131133e+02  0.166939e+03 -0.30428e+03
    0.131133e+02  0.164193e+03  0.35537e+03
    0.131133e+02  0.161445e+03 -0.35170e+03
    0.131133e+02  0.158698e+03 -0.69565e+02
    0.131133e+02  0.155950e+03 -0.16408e+03
    0.131133e+02  0.153203e+03 -0.19651e+03
    0.131133e+02  0.150455e+03  0.48802e+03
    0.131133e+02  0.147707e+03  0.22369e+03
    0.131133e+02  0.144959e+03 -0.56735e+03
    0.131133e+02  0.142212e+03  0.47031e+03
    0.131133e+02  0.139464e+03  0.71274e+03
    0.131133e+02  0.136716e+03 -0.13090e+03
    0.131133e+02  0.133968e+03 -0.12792e+04
    0.131133e+02  0.131220e+03 -0.49613e+04
    0.131133e+02  0.128472e+03  0.82584e+03
    0.131133e+02  0.125724e+03  0.35293e+03
    0.131133e+02  0.122976e+03  0.35142e+04
    0.131133e+02  0.120228e+03 -0.46563e+04
    0.131133e+02  0.117480e+03 -0.66907e+04
    0.131133e+02  0.114732e+03 -0.83272e+03
    0.131133e+02  0.111984e+03 -0.35126e+04
    0.131133e+02  0.109236e+03 -0.14394e+04
    0.131133e+02  0.106488e+03  0.82829e+03
    0.131133e+02  0.103740e+03  0.53543e+04
    0.131133e+02  0.100992e+03 -0.36417e+04
    0.131133e+02  0.982440e+02 -0.44585e+05
    0.131133e+02  0.954960e+02 -0.11018e+06
    0.131133e+02  0.927480e+02 -0.20769e+06
    0.131133e+02  0.900000e+02 -0.29267e+06
    0.131133e+02  0.872520e+02 -0.22303e+06
    0.131133e+02  0.845040e+02 -0.15485e+06
    0.131133e+02  0.817560e+02 -0.52735e+05
    0.131133e+02  0.790080e+02 -0.31535e+05
    0.131133e+02  0.762600e+02 -0.49130e+05
    0.131133e+02  0.735119e+02 -0.19675e+05
    0.131133e+02  0.707639e+02 -0.75015e+04
    0.131133e+02  0.680159e+02  0.11541e+05
    0.131133e+02  0.652679e+02  0.48376e+04
    0.131133e+02  0.625200e+02  0.13548e+05
    0.131133e+02  0.597720e+02  0.18087e+03
    0.131133e+02  0.570240e+02 -0.17520e+05
    0.131133e+02  0.542760e+02 -0.11684e+05
    0.131133e+02  0.515280e+02 -0.14957e+03
    0.131133e+02  0.487801e+02  0.47116e+04
    0.131133e+02  0.460321e+02  0.43422e+04
    0.131133e+02  0.432842e+02 -0.61841e+04
    0.131133e+02  0.405363e+02  0.66017e+03
    0.131133e+02  0.377884e+02 -0.26962e+04
    0.131133e+02  0.350405e+02  0.70206e+03
    0.131133e+02  0.322927e+02 -0.15177e+04
    0.131133e+02  0.295449e+02  0.10130e+04
    0.131133e+02  0.267972e+02 -0.11742e+04
    0.131133e+02  0.240495e+02  0.93792e+03
    0.131133e+02  0.213020e+02 -0.12273e+04
    0.131133e+02  0.185546e+02  0.13699e+04
    0.131133e+02  0.158074e+02 -0.14457e+04
    0.131133e+02  0.130606e+02  0.13376e+04
    0.131133e+02  0.103145e+02 -0.13678e+04
    0.131133e+02  0.756973e+01  0.14755e+04
    0.131133e+02  0.482861e+01 -0.20019e+04
    0.131133e+02  0.210359e+01  0.31240e+04
  </code></pre>
  <p>After running the python code - I got the following error:</p>
  <p>Traceback (most recent call last):
  File &quot;./final.py&quot;, line 5, in 
  data = np.genfromtxt('test.txt', delimiter=' ')
  raise ValueError(errmsg)
  ValueError: Some errors were detected !
  Line #2 (got 5 columns instead of 4)
  Line #39 (got 5 columns instead of 4)
  Line #40 (got 5 columns instead of 4)
  Line #41 (got 5 columns instead of 4)
  ..</p>
  <p>Could you help me to fix this error and make contour plot? Thanks!</p>