Le mercredi 16 avril 2014 11:08:31 UTC+2, RecentConvert a écrit : > > Is there a faster way of doing this? > > Dstr2 = Array(Float64,length(Dstc["time"])-1,2) # Preallocate averaged > Dstr array > for i=1:1:length(Dstc["time"]) - 1 > f = find(Dstc["time"][i] .<= Dstr["time"] .< Dstc["time"][i+1]) > dN = Dstr["NH3"][f] > > Dstr2[i,1] = f[1] > Dstr2[i,2] = mean(dN) > end > > > Dstr and Dstc are both dataframes. > I think you want the hist function here. http://docs.julialang.org/en/latest/stdlib/base/?highlight=hist#Base.hist
You are also probably aware of the StatsBase package, which may be helpful. http://statsbasejl.readthedocs.org/en/latest/index.html
