1

I am using a numpy memmap object that acts as a 2D array:

In [8]: data_2d.shape  
Out[8]: (16777216, 50)

What is the best way to delete a row in which the sum of that row is zero?

lukess
  • 964
  • 1
  • 14
  • 19
SabCo
  • 61
  • 1
  • 5
  • 1
    For an ordinary array you can delete rows by `data1 = data[mask,:]` where `mask` is a boolean (or `where` list) of the rows you want to keep. `np.delete` can do the same thing, given the rows you want to delete. But either case produces a new array. I'm not sure that will work with a `memmap`. – hpaulj Jul 09 '17 at 02:58

0 Answers0