So you have a stream that produces rows one after another? I feel like this might be a place for an abstraction like collect.
-- John On Sep 12, 2014, at 3:51 PM, Florian Oswald <florian.osw...@gmail.com> wrote: > it's literally just a single row. I have a master_df where I collect the > data. then there is a smaller groups_df on which I do repeatedly some > operations on rows, and after each operation on a single row I want to copy > it to the master_df with > > push!(master_df, array( current_row_of_groups_df ) ) > > i think in general i should avoid growing arrays (and dataframes) and > allocate the full object beforehand, but it's very convenient to push onto > master_df in this way, without having to lookup the right index where to put > it. > > On 12 September 2014 22:45, John Myles White <johnmyleswh...@gmail.com> wrote: > Well, slow might be a little unfair. Are you transferring only a subset of > rows from the other DataFrame? If so, this might be a good approach. If > you're copying the whole thing, it seems a lot slower. > -- John > > > On Sep 12, 2014, at 3:42 PM, Florian Oswald <florian.osw...@gmail.com> wrote: > >> oh, i didnt' know it's slow. yes in my case it's a way of transferring a row >> from one df to another. what's a better way of doing this? >> >> On 12 September 2014 22:39, John Myles White <johnmyleswh...@gmail.com> >> wrote: >> What does that mean? A DataFrameRow can't be easily created without >> reference to an existing DataFrame, so this seems like it's either a >> mechanism for transferring rows from one DataFrame to another very slowly or >> a mechanism for inserting duplicate rows. >> >> -- John >> >> On Sep 12, 2014, at 3:37 PM, Florian Oswald <florian.osw...@gmail.com> wrote: >> >>> I'll submit a PR for Base.append!(adf::AbstracDataFrame,dfr::DataFrameRow) >>> unless you tell me that's useless. >>> >>> On 12 September 2014 22:31, Florian Oswald <florian.osw...@gmail.com> wrote: >>> Leah: yeah that works. but i think i almost prefer my previous solution, >>> instead of this push!(df2,[v for (_,v) in e]) >>> that: >>> push!(df2,array(e)) >>> >>> not sure about the performance implications though. >>> >>> >>> >>> >>> On 12 September 2014 22:18, Gray Calhoun <gcalh...@iastate.edu> wrote: >>> Oh, I wasn't thinking of that. Good point. A mutating OrderedDict >>> constructor would allow reuse, but isn't as generic. >>> >>> >> >> > >