def indicator_d(textA, textB, d): indicatordf = data.getIndicatorDf(textA+"/"+textB) output = [] for i,idx in enumerate(indicatordf.index): if i > len(indicatordf)-int(d): output.append({"count":indicatordf.ix[idx], "date":idx.strftime('%Y-%m-%d')}) return Response(json.dumps(output), mimetype='application/json')
def indicator(textA, textB): indicatordf = data.getIndicatorDf(textA+"/"+textB) output = [] for idx in indicatordf.index: output.append({"count":indicatordf.ix[idx], "date":idx.strftime('%Y-%m-%d')}) return Response(json.dumps(output), mimetype='application/json')