def test_biweight_location_axis_3d():
 with NumpyRNGContext(12345):
  nz = 3
  ny = 4
  nx = 5
  data = normal(5, 2, (nz, ny, nx))
  bw = funcs.biweight_location(data, axis=0)
  assert (bw.shape == (ny, nx))
  y = 0
  bwi = []
  for i in range(nx):
   bwi.append(funcs.biweight_location(data[:, y, i]))
  bwi = np.array(bwi)
  assert_allclose(bw[y], bwi)

def test_biweight_location_axis_3d ( ) : with NumpyRNGContext ( 12345 ) : nz = 3 ny = 4 nx = 5 data = normal ( 5 , 2 , ( nz , ny , nx ) ) bw = funcs . biweight_location ( data , axis = 0 ) assert ( bw . shape == ( ny , nx ) ) y = 0 bwi = [ ] for i in range ( nx ) : bwi . append ( funcs . biweight_location ( data [ : , y , i ] ) ) bwi = np . array ( bwi ) assert_allclose ( bw [ y ] , bwi )
test a 3d array with the axis keyword .