pandas_to_json.mako 319 B

12345678910111213141516171819
  1. <%page args="df"/>
  2. <%
  3. """Comments about this template file.
  4. """
  5. # Python imports, helper function definitions, etc.
  6. import pandas
  7. %>
  8. <%text>
  9. {
  10. labels: </%text> ${df.labels.values.tolist()} <%text>,
  11. datasets: [
  12. {
  13. data: </%text> ${df.data.values.tolist()} <%text>
  14. }
  15. ]
  16. }
  17. </%text>