0

I have an array of size (1, 100, 81).

I want to remove the first column of the array and I need an array of size (1, 99, 81).

How to split the array into (1, 1, 81) and (1, 99, 81). I tried using np.split() but I think I am wrong for this type of array.

Reminder: I don't want to split into halves.

Gaurav Mall
  • 2,372
  • 1
  • 17
  • 33
Krush23
  • 723
  • 7
  • 19
  • Possible duplicate of [Split list into smaller lists (split in half)](https://stackoverflow.com/questions/752308/split-list-into-smaller-lists-split-in-half) – Gaurav Mall Aug 11 '19 at 14:52
  • Not splitting the array into half. Btw I got the answer. Thanks for the comment. – Krush23 Aug 11 '19 at 14:53
  • Your welcome, the article was specifically about splitting in half but you can use the implementation for your purposes :) – Gaurav Mall Aug 11 '19 at 14:55

2 Answers2

2

Try this one if you use numpy array

 array = array[0, 1:,:]
0
list2 = [list1[0].pop(0)]

should do it, assuming list1 is a standard python list-of-lists-of-lists. This removes the first "column" of list1 using pop(0), and then puts it into a new list, all in one step.

Green Cloak Guy
  • 23,793
  • 4
  • 33
  • 53