Skip to content

Instantly share code, notes, and snippets.

@estysdesu
Last active July 21, 2019 05:02
Show Gist options
  • Save estysdesu/ac1705dda92b29a8fea33db1729fb36d to your computer and use it in GitHub Desktop.
Save estysdesu/ac1705dda92b29a8fea33db1729fb36d to your computer and use it in GitHub Desktop.
[Python: Numpy mask arrays] #numpy #maskarray #python #ma #np
import numpy as np
x1 = np.ma.array([0, 1, 2, 3, 4])
x1.mask # --> [False]
x2 = np.ma.array([0, 1, 2, 3, 4], mask=[False]) # triggers mask expansion
x2.mask # --> [False, False, False, False, False]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment