Answer the question
In order to leave comments, you need to log in
How to assign data by key and output to template?
There is such a problem, in this jason there are categories with words and the number of words separately, you need to add their number inside the category, and display them in the template
{'amazing': 3111, 'fear': 665, 'panic': 155, 'content': 3089, 'weak': 2208, ' joy ': 174, ' sad ': 1438, 'envy': 89, 'jealous': 336, 'apathy': 13, 'categories': {'happiness': ['happy', 'content', 'amazing', 'love', 'joy'], 'anger': ['apathy', 'hate', 'angry'], 'anxiousness': ['anxious', 'jealous', 'afraid', 'envy', 'panic', 'weak'], 'sadness': ['sad', 'grief', 'depression', 'guilt','confusion']}, 'confus': 1531, 'happy': 3369, 'grief': 76, 'guilt': 120, 'angry': 388, 'depress': 852, 'hate': 3257, 'anxious': 162, 'love': 10681, 'afraid': 733}
{% for category in emotions.categories %}
<table class="rwd-table">
<thead>
<tr>
<th colspan="3">Words in 'Happiness, Contentment, Amazement, Love, Joy & Strength'</th>
</tr>
</thead>
<tbody>
<tr class="t-head">
<td>Word</td>
<td>Intencity</td>
<td>Frequency</td>
</tr>
{% for emotion in category %}
<tr>
<td>{{ emotion }}</td>
<td>5</td>
<td>15977</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question