masked_where broadcasting?
24 Jul
2014
24 Jul
'14
5:53 p.m.
I ran into this this morning while writing up a new test for matplotlib. Shouldn't these two arrays be broadcasted automatically or maybe np.ma is being overly cautious? u = np.ma.masked_where((-0.4 < x) & (x < 0.1), u, copy=False) File "/home/ben/.local/lib/python2.7/site-packages/numpy/ma/core.py", line 1806, in masked_where " (got %s and %s)" % (cshape, ashape)) IndexError: Inconsistant shape between the condition and the input (got (10, 1, 1) and (10, 10, 3)) x has shape (10, 1, 1) and u has shape (10, 10, 3). This is on a recent-ish numpy master. Cheers! Ben Root
3766
Age (days ago)
3766
Last active (days ago)
0 comments
1 participants
participants (1)
-
Benjamin Root