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. 

Reply via email to