title: Pandas GroupBy object is not 'serializable' by Plot.ly
body: <p>I'm trying to create a boxplot using Plotly and I get an error when attempting to use a Pandas DataFrame that's been grouped. Some initial digging produced this chunk of code to convert Pandas to Plotly interface:</p>
  
  <pre><code>def df_to_iplot(df):
  
  '''
  Coverting a Pandas Data Frame to Plotly interface
  '''
  x = df.index.values
  lines={}
  for key in df:
      lines[key]={}
      lines[key]["x"]=x
      lines[key]["y"]=df[key].values
      lines[key]["name"]=key
  
      #Appending all lines
  lines_plotly=[lines[key] for key in df]
  return lines_plotly
  </code></pre>
  
  <p>Are there alternatives to this method of converting DataFrame's to a Plotly-compatible series? The above code is for line graphs, but I'd like to iterate over my dimensions to produce a boxplot for each group in my DataFrame. Here is the error message I'm getting:</p>
  
  <p>"TypeError: pandas.core.groupby.SeriesGroupBy object  is not JSON serializable"</p>
  
  <p>Here is an example from the Plotly website: <a href="https://plot.ly/python/box-plots" rel="nofollow">https://plot.ly/python/box-plots</a></p>
  
  <pre><code>import plotly.plotly as py
  from plotly.graph_objs import *
  
  py.sign_in("xxxx", "xxxxxxxxxx")
  
  import numpy as np
  y0 = np.random.randn(50)
  y1 = np.random.randn(50)+1
  
  trace0 = Box(
      y=y0
  )
  trace1 = Box(
      y=y1
  )
  data = Data([trace0, trace1])
  
  unique_url = py.plot(data, filename = 'basic-box-plot')
  </code></pre>