You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently np.insert do not follow the masked rules of a np.ma.Maskedarray.
How to Reproduce:
import numpy as np
a=np.ma.masked_array([1,0],[0,1])
b=np.insert(a,len(a),np.ma.masked_array([0,1],[1,0]),axis=0)
len(b.mask)
outputs:
object of type 'numpy.bool_' has no len()
So the insert function doens't take the mask in account even if the input is masked. The same behaviour occurs when input is not masked, so the operation causes a lost of the masking information ( it would be desirable that even in this case the output would be at least not masked and the operation would preserve the mask information).
I believed that the mask information would be passthrough to the new array.
The text was updated successfully, but these errors were encountered:
Currently np.insert do not follow the masked rules of a np.ma.Maskedarray.
How to Reproduce:
outputs:
object of type 'numpy.bool_' has no len()
So the insert function doens't take the mask in account even if the input is masked. The same behaviour occurs when input is not masked, so the operation causes a lost of the masking information ( it would be desirable that even in this case the output would be at least not masked and the operation would preserve the mask information).
I believed that the mask information would be passthrough to the new array.
The text was updated successfully, but these errors were encountered: