iarray.IArray.delete#

IArray.delete(delete_len, axis=0, start=None)#

Delete delete_len positions along the axis from the start.

Parameters
  • delete_len (int) – The number of elements to delete in the array.shape[axis].

  • axis (int, optional) – The axis that will be shrunk. Default is 0.

  • start (int, None, optional) – The starting point for deleting the elements. If None (default) the deleted elements will be at the end of the array.

Notes

If delete_len is not a multiple of chunks[axis], start must be either None or shape[axis] - delete_len (which are equivalent). Otherwise, start must also be a multiple of chunks[axis].

For example, let’s suppose that we have an array with shape = [20, 20] and chunks = [7, 7]. If delete_len = 5 and axis = 0, because delete_len is not a multiple of chunks[axis], start must be None or shape[axis] - delete_len = 15. In both cases, the deleted elements will be the same (those at the end) and the new shape will be [15, 20]. If we would like to delete some elements in the middle of the array, start and delete_len both must be a multiple of chunks[axis]. So the only possibilities is this particular case would be start = 0 and delete_len = 7 or delete_len = 14 which would give an array with shape [13, 20] or [6, 20]. Or start = 7 and delete_len = 7 which would give an array with shape [13, 20].

See also

resize, insert, append