{"action":"opened","issue":{"url":"https://api.github.com/repos/ioam/holoviews/issues/891","repository_url":"https://api.github.com/repos/ioam/holoviews","labels_url":"https://api.github.com/repos/ioam/holoviews/issues/891/labels{/name}","comments_url":"https://api.github.com/repos/ioam/holoviews/issues/891/comments","events_url":"https://api.github.com/repos/ioam/holoviews/issues/891/events","html_url":"https://github.com/ioam/holoviews/issues/891","id":180101018,"number":891,"title":"Numpy np.ma MaskedArray support","user":{"login":"jbednar","id":1695496,"avatar_url":"https://avatars.githubusercontent.com/u/1695496?v=3","gravatar_id":"","url":"https://api.github.com/users/jbednar","html_url":"https://github.com/jbednar","followers_url":"https://api.github.com/users/jbednar/followers","following_url":"https://api.github.com/users/jbednar/following{/other_user}","gists_url":"https://api.github.com/users/jbednar/gists{/gist_id}","starred_url":"https://api.github.com/users/jbednar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbednar/subscriptions","organizations_url":"https://api.github.com/users/jbednar/orgs","repos_url":"https://api.github.com/users/jbednar/repos","events_url":"https://api.github.com/users/jbednar/events{/privacy}","received_events_url":"https://api.github.com/users/jbednar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-29T16:37:39Z","updated_at":"2016-09-29T16:37:39Z","closed_at":null,"body":"Currently, a Numpy MaskedArray supplied as the data source for various HoloViews Elements will be accepted, but the mask will not be respected.  E.g.:\r\n\r\n```python\r\nfrom numpy import ma\r\nimport holoviews as hv\r\nhv.notebook_extension()\r\n\r\nunmasked = np.array([2,4,1,5,6,np.nan,2,5],dtype=float)\r\nmasked = ma.array(np.array(unmasked),mask=np.array([0,0,1,1,0,0,0,0]),fill_value=np.nan)\r\n\r\nhv.Curve(unmasked) + hv.Curve(masked.filled()) + hv.Curve(masked)\r\n```\r\n\r\n![image](https://cloud.githubusercontent.com/assets/1695496/18962945/70aac7d0-8638-11e6-95ca-7bbc7008d59d.png)\r\n\r\nHere NaN values in the original array are respected, and masked-out values are respected if they are converted to NaN values by .filled(), but passing the masked array without .filled() gives the same output as the non-masked array.\r\n\r\nAdding full support for masked arrays seems daunting, but we could (a) suggest that people convert such arrays to floats and then fill with NaNs before viewing, and (b) consider adding a check to warn if a user passes a masked array (without first filling it to become a regular non-masked ndarray)."}}
{"actor":{"display_login":"jbednar"}}