Skip to content

Latest commit

 

History

History
64 lines (42 loc) · 1.05 KB

remove.md

File metadata and controls

64 lines (42 loc) · 1.05 KB

remove

Remove entries from an array at the given indices.

API

Numeric.shape.remove(input, indices, level)

Removes the indexed entries from the array.

  • Parameters:
    • input: Array losing the selected entries
    • indices: Positions of the entries to remove
    • level: Optional axis along which entries are removed
  • Returns: Array without the removed entries
  • NumPy: Equivalent to np.delete.

Examples

Remove one entry

import Numeric from '@neabyte/numerix'

const values = Numeric.shape.remove([1, 2, 3], [1])

console.log(values)
// [1,3]

Remove the first entry

import Numeric from '@neabyte/numerix'

const values = Numeric.shape.remove([1, 2, 3], [0])

console.log(values)
// [2,3]

Remove the last entry

import Numeric from '@neabyte/numerix'

const values = Numeric.shape.remove([1, 2, 3], [2])

console.log(values)
// [1,2]

Remove several entries

import Numeric from '@neabyte/numerix'

const values = Numeric.shape.remove([1, 2, 3, 4], [0, 2])

console.log(values)
// [2,4]