html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/4482#issuecomment-708088129,https://api.github.com/repos/pydata/xarray/issues/4482,708088129,MDEyOklzc3VlQ29tbWVudDcwODA4ODEyOQ==,5635139,2020-10-14T00:50:40Z,2020-10-14T00:50:40Z,MEMBER,"Right — that makes sense now. Given that `.fillna(0)` creates a copy, when we're doing stride tricks in the form of `construct` then that copy can be huge.
So I think there's a spectrum of implementations of `skipna`, o/w two are:
- as a convenient alias of `.fillna(0)`, like @mathause 's [example above](https://github.com/pydata/xarray/issues/4482#issuecomment-702965721) IIUC
- ensuring a copy isn't made, which may require diving into `np.einops` (or open to alternatives)
The second would be required for @heerad 's case above","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,713834297
https://github.com/pydata/xarray/issues/4482#issuecomment-707270259,https://api.github.com/repos/pydata/xarray/issues/4482,707270259,MDEyOklzc3VlQ29tbWVudDcwNzI3MDI1OQ==,1217238,2020-10-12T18:08:55Z,2020-10-12T18:08:55Z,MEMBER,"> I'm happy to live with a memory copy for now with `fillna` and `notnull`, but allocating the full, un-chunked array into memory is a showstopper. Is there a different workaround that I can use in the meantime?
This is surprising behavior, and definitely sounds like a bug!
If you could put together a minimal test case for reproducing the issue, we could look into it. It's hard to say what a work-around would be without knowing the source of the issue.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,713834297
https://github.com/pydata/xarray/issues/4482#issuecomment-706442785,https://api.github.com/repos/pydata/xarray/issues/4482,706442785,MDEyOklzc3VlQ29tbWVudDcwNjQ0Mjc4NQ==,5635139,2020-10-09T23:29:23Z,2020-10-09T23:29:23Z,MEMBER,"Maybe on very small arrays it's quicker to do a product than a copy? As the array scales, it's surely not — dot product is O(n^3) or similar. I would be interested to see a repro...","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,713834297
https://github.com/pydata/xarray/issues/4482#issuecomment-706140256,https://api.github.com/repos/pydata/xarray/issues/4482,706140256,MDEyOklzc3VlQ29tbWVudDcwNjE0MDI1Ng==,10194086,2020-10-09T12:01:37Z,2020-10-09T12:01:37Z,MEMBER,"`fillna` is basically `where(notnull(data), data, other)`. I think what takes the longest is the `where` part - possibly making a memory copy(?).","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,713834297
https://github.com/pydata/xarray/issues/4482#issuecomment-704634447,https://api.github.com/repos/pydata/xarray/issues/4482,704634447,MDEyOklzc3VlQ29tbWVudDcwNDYzNDQ0Nw==,5635139,2020-10-07T01:12:09Z,2020-10-07T01:12:09Z,MEMBER,"Any idea why `x.fillna(0.)` is so much more expensive than `x.dot(y)`?
For some functions where `fillna(0.)` has a different result to `skipna=True`, I could see it being worthwhile to writing new routines. But for dot product, it's definitionally the same. And `fillna` seems a much simpler operation than `dot`...","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,713834297
https://github.com/pydata/xarray/issues/4482#issuecomment-704064370,https://api.github.com/repos/pydata/xarray/issues/4482,704064370,MDEyOklzc3VlQ29tbWVudDcwNDA2NDM3MA==,1217238,2020-10-06T06:38:51Z,2020-10-06T06:38:51Z,MEMBER,"I agree this would be welcome! Even if it isn't much faster than the options already shown here, at least we could point users to the _best_ option we know of.
I suspect achieving the full speed of `dot()` with skip-NA support is impossible, but we can probably do much better. I might start by prototyping something in Numba, just to get a sense of what is achievable with a low-level approach. But keep in mind that functions like `np.dot` and `np.einsum` (""GEMM"") are a few of the most highly optimized routines in numerical computing.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,713834297
https://github.com/pydata/xarray/issues/4482#issuecomment-702965721,https://api.github.com/repos/pydata/xarray/issues/4482,702965721,MDEyOklzc3VlQ29tbWVudDcwMjk2NTcyMQ==,10194086,2020-10-02T21:27:33Z,2020-10-02T21:27:33Z,MEMBER,"Yes that would be very helpful. This is used for the weighted operations:
https://github.com/pydata/xarray/blob/333e8dba55f0165ccadf18f2aaaee9257a4d716b/xarray/core/weighted.py#L129-L135
and it would be great if this could be done upstream. However, `dot` is implemented using `np.einsum` which is quite a gnarly beast.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,713834297
https://github.com/pydata/xarray/issues/4482#issuecomment-702937094,https://api.github.com/repos/pydata/xarray/issues/4482,702937094,MDEyOklzc3VlQ29tbWVudDcwMjkzNzA5NA==,5635139,2020-10-02T20:13:37Z,2020-10-02T20:13:37Z,MEMBER,"I agree this would be a welcome option.
As a workaround, you could fillna with zero?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,713834297