サブクラスを書き込もうとしていmasked_array
ます。私がこれまでに持っているのはこれです:
class gridded_array(ma.core.masked_array):
def __init__(self, data, dimensions, mask=False, dtype=None,
copy=False, subok=True, ndmin=0, fill_value=None,
keep_mask=True, hard_mask=None, shrink=True):
ma.core.masked_array.__init__(data, mask, dtype, copy, subok,
ndmin, fill_value, keep_mask, hard_mask,
shrink)
self.dimensions = dimensions
ただし、今作成するgridded_array
と、期待したものが得られません。
dims = OrderedDict()
dims['x'] = np.arange(4)
gridded_array(np.random.randn(4), dims)
masked_array(data = [-- -- -- --],
mask = [ True True True True],
fill_value = 1e+20)
マスクされていない配列を期待します。dimensions
私が渡した引数が呼び出しで渡されるのではないかと疑っていますmasked_array.__init__
が、私はOOPにまったく慣れていないため、これを解決する方法がわかりません。
どんな助けでも大歓迎です。
PS:私はPython2.7を使用しています