Search code examples
google-cloud-datalab

In datalab, Is it possible to pass data into a chart from python?


Trying to figure out if it is possible to reference python data as a source for creating a chart.


Solution

  • Here is a working example:

    data = [
            {'date': '2016/01/01', 'count': 10}, 
            {'date': '2016/01/02', 'count': 15}, 
            {'date': '2016/01/03', 'count': 12} 
           ]
    %chart pie -d data
    

    As mentioned in the following post, check the browser console for additional detail regarding errors:

    %%chart line graph in Datalab based on Bigquery data not rendering