I actually wanted to iterate over the data in the template?
But how do I play my pivot data in context and treat them in the template?
df = pd.DataFrame(data)
pv = df.pivot(index='cands', columns='titles', values='grades')
context['quizzes'] = pv.to_html(classes='table', border=0, na_rep = '')
In the template I'm doing {{ quizzes }}
, but I wanted to do
{% for quiz in quizzes %}
<tr>
<td>{{ quiz.first_name }}</td>
<td>{{ quiz.title }}</td>
</tr>
{% endfor %}
So on.