title: Why am I getting this error: TypeError: Input must be a 2D array
body: <p>I am working on a python code to plot Eddy Kinetic Energy. I am fairly new to python and I'm confused about an error I have been getting. I'm not worried about plotting my data on a map just yet, I just want to see if I can get it to plot. Here is my code and error: </p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  import matplotlib.cm as cm
  from pylab import *
  from netCDF4 import Dataset
  from mpl_toolkits.basemap import Basemap
  import matplotlib.cm as cm
  
  from mpl_toolkits.basemap import shiftgrid
  test = Dataset('p.34331101.atmos_daily.nc', 'r')
  
  lat = test.variables['lat'][:]
  lon = test.variables['lon'][:]
  level = test.variables['level'][5]
  time = test.variables['time'][:]
  u = test.variables['ucomp'][:]
  v = test.variables['vcomp'][:]
  temp = test.variables['temp'][:]
  
  print(lat.shape)
  print(u.shape)
  #uz = np.reshape(u, (30, 26, 90))
  uzm = np.nanmean(u, axis=3)
  
  #vz = np.reshape(v, (30, 26, 90))
  vzm = np.nanmean(v, axis=3)
  print(uzm.shape)
  
  ustar = u-uzm[:,:,:,np.newaxis]
  vstar = v-vzm[:,:,:,np.newaxis]
  
  EKE = np.nanmean(.5*(ustar**2 + vstar**2), axis=3)
  
  EKE1 = np.asarray(EKE)
  %matplotlib inline
  
  print(EKE.shape)
  
  levels=[-10, -5, 0, 5, 10]
  plt.contour(EKE[1,1,:])
  #EKE is time, level, lat and the shape is (30, 26, 90)
  </code></pre>
  
  <p><strong>TypeError: Input must be a 2D array.</strong></p>