-4

I wanted to remove an array outside numpy array of arrays

my current array looks like this:

 array([array([1,2,3],[3,4,5],[34,31,23])])

I want to remove the first array:

array([array([1,2,3],[3,4,5],[34,31,23])])

Nischay Namdev
  • 523
  • 5
  • 21

2 Answers2

0

numpy .toList() function should convert the first array into a list of arrays.

arrayModified = array.toList()

where array variable is the array you want to convert.

CrmXao
  • 667
  • 2
  • 13
  • 17
0

You can use np.delete() Read Here

Let arr = array([array([1,2,3],[3,4,5],[34,31,23])])

If you want to delete first array

use arr = np.delete(arr, 0, 0)

first 0 for index and second 0 for axis number