def test_biweight_midvariance_axis():
 with NumpyRNGContext(12345):
  ny = 100
  nx = 200
  data = normal(5, 2, (ny, nx))
  bw = funcs.biweight_midvariance(data, axis=0)
  bwi = []
  for i in range(nx):
   bwi.append(funcs.biweight_midvariance(data[:, i]))
  bwi = np.array(bwi)
  assert_allclose(bw, bwi)
  bw = funcs.biweight_midvariance(data, axis=1)
  bwi = []
  for i in range(ny):
   bwi.append(funcs.biweight_midvariance(data[i, :]))
  bwi = np.array(bwi)
  assert_allclose(bw, bwi)

def test_biweight_midvariance_axis ( ) : with NumpyRNGContext ( 12345 ) : ny = 100 nx = 200 data = normal ( 5 , 2 , ( ny , nx ) ) bw = funcs . biweight_midvariance ( data , axis = 0 ) bwi = [ ] for i in range ( nx ) : bwi . append ( funcs . biweight_midvariance ( data [ : , i ] ) ) bwi = np . array ( bwi ) assert_allclose ( bw , bwi ) bw = funcs . biweight_midvariance ( data , axis = 1 ) bwi = [ ] for i in range ( ny ) : bwi . append ( funcs . biweight_midvariance ( data [ i , : ] ) ) bwi = np . array ( bwi ) assert_allclose ( bw , bwi )
test a 2d array with the axis keyword .