Error while accessing an associative array
There's not a pretty way to do it in Twig other than what you've done in the if part of your conditional.  Something like this should work:

{% if attribute(data, entry_name) is not defined and entry_total &gt; 0 %}
    {% set data = data|merge({ (entry_name) : entry_total }) %}
{% else %}
    {% set data = data|merge({ (entry_name): 10 }) %}
{% endif %}