title: What is this called: Melting? Pivoting? Reshaping?
body: <p>This is a question about using pandas and ggplot in Python, but an R answer would also be very much appreciated.</p>
  
  <p>I am trying to plot some timeseries data that look somewhat like what's shown below. X, Y, Z are well-plate ids (names of experiments), and 0,1,2 are different times. I want to be able to plot the time course as a line graph both in different panes/subplots/facets, and in the same facet but with different colors.</p>
  
  <pre><code>   X    Y    Z
  0  0.1  0.2  0.3
  1  1.1  1.2  1.3
  2  2.1  2.2  2.3
  </code></pre>
  
  <p>I know that pandas combined with ggplot would let me say</p>
  
  <pre><code>from ggplot import *
  ggplot(aes(x='T', y='value', color='well'), data = df) + geom_line()
  </code></pre>
  
  <p>or</p>
  
  <pre><code>from ggplot import *
  ggplot(aes(x='T', y='value'), data = df) + geom_line() + facet_grid(x='well')
  </code></pre>
  
  <p>if df looked like this</p>
  
  <pre><code>well  T   value
  X     0   0.1
  X     1   1.1
  X     2   2.1
  Y     0   0.2
  Y     1   1.2
  Y     2   2.2
  Z     0   0.3
  Z     1   1.3
  Z     2   2.3  
  </code></pre>
  
  <p>, with rows not necessarily in that order.</p>
  
  <p>My question is, how do I make the data frame above into the data frame below the code, and what is this operation called? Again, I'm mainly interested in pandas and ggplot in Python, but an answer as to how this could be done in R would also be very helpful.</p>
  
  <p>I would also appreciate it if someone can recommend a good source to learn about doing such things with data.</p>