title: Generating a Plotly Heat Map from a pandas pivot table
body: <p>I've been searching this topic for a couple hours now, and still can't get my code to work.  I am trying to generate a heat map from a pivot table I've created using pandas. I'm very new to coding and am probably not using the right terminology, but I'll try my best.</p>
  
  <p>My table looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/hBJyB.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>It has many more rows as well.  I am trying to generate a plotly heat map with the countries on the y axis, the 4 ownership types on the x, and the numeric values being used as the z values.  I've been getting a lot of errors, but I think I'm getting close because it gets to my last line and says "TypeError: Object of type 'DataFrame' is not JSON serializable."  I've searched this error but can't find anything that I can understand.  I set up the table like so, and am having trouble with the z, x, and y inputs:</p>
  
  <pre><code>data = [go.Heatmap(z=[Country_Ownership_df[['Company Owned', 'Franchise', 'Joint Venture', 'Licensed']]],
                     y=[Country_Ownership_df['Country']],
                     x=['Company Owned', 'Franchise', 'Joint Venture', 'Licensed'],
                     colorscale=[[0.0, 'white'], [0.000001, 'rgb(191, 0, 0)'], [.001, 'rgb(209, 95, 2)'], [.005, 'rgb(244, 131, 67)'], [.015, 'rgb(253,174,97)'], [.03, 'rgb(249, 214, 137)'], [.05, 'rgb(224,243,248)'], [0.1, 'rgb(116,173,209)'], [0.3, 'rgb(69,117,180)'], [1, 'rgb(49,54,149)']])]
  
  layout = go.Layout(
      margin = dict(t=30,r=260,b=30,l=260),
      title='Ownership',
      xaxis = dict(ticks=''),
      yaxis = dict(ticks='', nticks=0 )
  )
  fig = go.Figure(data=data, layout=layout)
  #iplot(fig)
  plotly.offline.plot(fig, filename= 'tempfig3.html')
  </code></pre>
  
  <p>It's probably a fairly simple task, I just haven't learned much with coding and appreciate any help you could offer.</p>