MCPcopy Create free account
hub / github.com/numpy/numpy / resize

Method resize

numpy/ma/core.py:4752–4768  ·  view source on GitHub ↗

.. warning:: This method does nothing, except raise a ValueError exception. A masked array does not own its data and therefore cannot safely be resized in place. Use the `numpy.ma.resize` function instead. This method is difficult to implement s

(self, newshape, refcheck=True, order=False)

Source from the content-addressed store, hash-verified

4750 return result
4751
4752 def resize(self, newshape, refcheck=True, order=False):
4753 """
4754 .. warning::
4755
4756 This method does nothing, except raise a ValueError exception. A
4757 masked array does not own its data and therefore cannot safely be
4758 resized in place. Use the `numpy.ma.resize` function instead.
4759
4760 This method is difficult to implement safely and may be deprecated in
4761 future releases of NumPy.
4762
4763 """
4764 # Note : the 'order' keyword looks broken, let's just drop it
4765 errmsg = "A masked array does not own its data "\
4766 "and therefore cannot be resized.\n" \
4767 "Use the numpy.ma.resize function instead."
4768 raise ValueError(errmsg)
4769
4770 def put(self, indices, values, mode='raise'):
4771 """

Callers 15

test_attributesMethod · 0.45
setup_methodMethod · 0.45
test_resizeMethod · 0.45
test_basicMethod · 0.45
test_int_shapeMethod · 0.45
test_none_shapeMethod · 0.45
test_0d_shapeMethod · 0.45
test_freeform_shapeMethod · 0.45
test_zeros_appendedMethod · 0.45
test_obj_objMethod · 0.45
test_empty_viewMethod · 0.45

Calls

no outgoing calls

Tested by 15

test_attributesMethod · 0.36
setup_methodMethod · 0.36
test_resizeMethod · 0.36
test_basicMethod · 0.36
test_int_shapeMethod · 0.36
test_none_shapeMethod · 0.36
test_0d_shapeMethod · 0.36
test_freeform_shapeMethod · 0.36
test_zeros_appendedMethod · 0.36
test_obj_objMethod · 0.36
test_empty_viewMethod · 0.36