0

I have a masked list such as:

[masked_array(data = [ 0.12963803],
         mask = False,
   fill_value = 1e+20), 
masked_array(data = 0.22379663389345425,
         mask = False,
   fill_value = 1e+20), 
masked_array(data = [ 0.13113253],
         mask = False,
   fill_value = 1e+20), 
masked_array(data = 0.14300584131111602,
         mask = False,
   fill_value = 1e+20)]

Which should be an array, but when I print(type(name_array)) it returns <class 'list'>. I want to unmask this object, something like would be

name_array.filled()

But of course I can not do this since:

AttributeError: 'list' object has no attribute 'filled'

If I use np.array(name_arrray) it returns an ndarray which can not be .filled()

I think I am missing something fundamental here, any tip?

Py-ser
  • 1,860
  • 9
  • 32
  • 58
  • The key point is that you have a list of arrays, not an array. You can apply `filled` to each element of that list, but you can't apply it to the list as a whole. How did you generate this list? – hpaulj Jul 25 '16 at 16:44
  • @hpaulj, Thanks! I appended masked elements into an empty array. If you make a real answer I can accept it. – Py-ser Jul 27 '16 at 09:07

0 Answers0