-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is there a variant of load!
that accumulates?
#252
Comments
I don't think that this is possible without allocating an additional buffer as For your information, there is some groupby + aggregation function defined here https://juliageo.org/CommonDataModel.jl/stable/tutorial1/#Grouping-and-reducing |
Thank you! I am doing the looping because I aggregate data from many different files, and I've found the multifile-reading to be quite slow in some instances (but perhaps I'll try to file a separate issue on that if I can). I'll try experimenting more with groupby+agg, which seems fast so far! |
I was curious if there exists (or is even possible to implement) a variant of
load!
that accumulates the array instead of (over)writing?e.g. if
x=ones(3,3)
andds["var"][:, :] == ones(3,3)
, and you doload_acc!(variable(ds, "var"), x, :, :)
, you'd getx .== 2
. I'm able to get around this by first writing data to a buffer, then accumulatingx
, but was just curious if there's a direct way of doing this... Could we quite useful for quickly accumulating statistics.My current code looks something like this:
... Thinking about this a bit more, I suppose in principle that what I'm suggesting above can be generalized to handle any type of metric, like
but I don't actually know if any of that is possible to do without (secretly?) allocating a buffer. So maybe my local implementation is the way to go?
The text was updated successfully, but these errors were encountered: