I am struggling with this for quite some time now, can someone explain a solution to this problem
if i = {'x': 123, 'y': 456} {'x': 675, 'y': 098}
turn it into
message: {
columns: [
["x": 123, "y": "456"],
["x": 675, "y": 098]
]
More Insights:
I have the following Data structure
[<OldSample {u'counter_name': u'cpu_util', u'user_id': u'id', u'resource_id': u'id', u'timestamp': u'2015-06-30T15:53:55', u'counter_volume': 0.043}]
I need to make it something like this to put in EON pubnub charting libaray (see link: http://www.pubnub.com/developers/eon/chart/spline/)
message: {
columns: [
["y": 0.043, "x": "2015-06-30T15:53:55"],
["y": 0.045, "x": "2015-06-30T15:53:55"]
]
Now I have the following code
def get_clean_Json(data):
for each in data:
timestamp = each.timestamp
volume = each.counter_volume
i = {'x': timestamp, 'y': volume}
print i
Which returns results like this
{'x': 123, 'y': 456} {'x': 675, 'y': 098}
and I am stuck here, no matter what I do I get errors