Best way to combine experiments in a dataframe

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Best way to combine experiments in a dataframe

Jason Merrill
What's the best idiom for combining dataframes with similar structure that represent, say, experiments on different days? Say I have dataframes df1, and df2. So far, I've come up with

df1[:day] = :day1
df2
[:day] = :day2
combined
= [df1; df2]

which is fine, but I'm wondering if there's some even terser way to accomplish this, maybe without mutating the original dataframes.

P.S. so far my main motivation for combining datasets this way is so that I can have gadfly plot them with separate colors, or as separate entries in a subplot grid.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Best way to combine experiments in a dataframe

John Myles White
That’s what I do. If you can think of a better interface for doing this, I’d be interested since I agree this is a little ugly.

 — John

On Jul 26, 2014, at 2:03 PM, Jason Merrill <[hidden email]> wrote:

What's the best idiom for combining dataframes with similar structure that represent, say, experiments on different days? Say I have dataframes df1, and df2. So far, I've come up with

df1[:day] = :day1
df2[:day] = :day2
combined = [df1; df2]

which is fine, but I'm wondering if there's some even terser way to accomplish this, maybe without mutating the original dataframes.

P.S. so far my main motivation for combining datasets this way is so that I can have gadfly plot them with separate colors, or as separate entries in a subplot grid.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Best way to combine experiments in a dataframe

Jason Merrill
As a straw man,

combine([df1, df2], [:day1, :day2], :day)

On Saturday, July 26, 2014 2:05:27 PM UTC-7, John Myles White wrote:
That’s what I do. If you can think of a better interface for doing this, I’d be interested since I agree this is a little ugly.

 — John

On Jul 26, 2014, at 2:03 PM, Jason Merrill <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="xMYZ1d3y-r8J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">jwme...@...> wrote:

What's the best idiom for combining dataframes with similar structure that represent, say, experiments on different days? Say I have dataframes df1, and df2. So far, I've come up with

df1[:day] = :day1
df2[:day] = :day2
combined = [df1; df2]

which is fine, but I'm wondering if there's some even terser way to accomplish this, maybe without mutating the original dataframes.

P.S. so far my main motivation for combining datasets this way is so that I can have gadfly plot them with separate colors, or as separate entries in a subplot grid.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="xMYZ1d3y-r8J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">julia-stats...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Best way to combine experiments in a dataframe

John Myles White
Maybe use that sort of interface, but call it vcat?

 — John

On Jul 26, 2014, at 3:27 PM, Jason Merrill <[hidden email]> wrote:

As a straw man,

combine([df1, df2], [:day1, :day2], :day)

On Saturday, July 26, 2014 2:05:27 PM UTC-7, John Myles White wrote:
That’s what I do. If you can think of a better interface for doing this, I’d be interested since I agree this is a little ugly.

 — John

On Jul 26, 2014, at 2:03 PM, Jason Merrill <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="xMYZ1d3y-r8J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">jwme...@...> wrote:

What's the best idiom for combining dataframes with similar structure that represent, say, experiments on different days? Say I have dataframes df1, and df2. So far, I've come up with

df1[:day] = :day1
df2[:day] = :day2
combined = [df1; df2]

which is fine, but I'm wondering if there's some even terser way to accomplish this, maybe without mutating the original dataframes.

P.S. so far my main motivation for combining datasets this way is so that I can have gadfly plot them with separate colors, or as separate entries in a subplot grid.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="xMYZ1d3y-r8J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">julia-stats...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Best way to combine experiments in a dataframe

John Myles White
In reply to this post by Jason Merrill
I opened an issue for this: https://github.com/JuliaStats/DataFrames.jl/issues/659

 — John

On Jul 26, 2014, at 3:27 PM, Jason Merrill <[hidden email]> wrote:

As a straw man,

combine([df1, df2], [:day1, :day2], :day)

On Saturday, July 26, 2014 2:05:27 PM UTC-7, John Myles White wrote:
That’s what I do. If you can think of a better interface for doing this, I’d be interested since I agree this is a little ugly.

 — John

On Jul 26, 2014, at 2:03 PM, Jason Merrill <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="xMYZ1d3y-r8J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">jwme...@...> wrote:

What's the best idiom for combining dataframes with similar structure that represent, say, experiments on different days? Say I have dataframes df1, and df2. So far, I've come up with

df1[:day] = :day1
df2[:day] = :day2
combined = [df1; df2]

which is fine, but I'm wondering if there's some even terser way to accomplish this, maybe without mutating the original dataframes.

P.S. so far my main motivation for combining datasets this way is so that I can have gadfly plot them with separate colors, or as separate entries in a subplot grid.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="xMYZ1d3y-r8J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">julia-stats...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.