# DICTIONARIES ... again

**URL:** <https://forum.dynamobim.com/t/dictionaries-again/10818>\
**Category:** Uncategorized\
**Created:** [April 4, 2017, 5:05pm UTC](https://forum.dynamobim.com/t/dictionaries-again/10818 "2017-04-04T17:05:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adrian\_Crisan](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@Adrian\_Crisan](https://forum.dynamobim.com/u/Adrian_Crisan)\
**Post date:** [April 4, 2017, 5:05pm UTC](https://forum.dynamobim.com/t/dictionaries-again/10818/1 "2017-04-04T17:05:38Z")

</div>

Hello -

I’m still struggling again with Dictionaries inside the PyNodes.

I try to create a Dictionary from a flattened list, but is giving me this error:

"  
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.  
‘int’ does not contain a definition for ‘Key’

"

In IronPython ( and of course Python) works well.

@ the creators of Dynamo: why this issue? In theory what works in IronPython should work the same inside PyNodes, or it is not? Please can you point out where we can find documentation for these issues?

Thanks for your help!

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/6/76f5b68f407ac7575287949cee4409b23d936296.jpg)

---

<div class="post-metadata">

**Author:** ![Thomas\_Mahon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thomas_mahon/32/64209_2.png) [@Thomas\_Mahon](https://forum.dynamobim.com/u/Thomas_Mahon)\
**Post date:** [April 4, 2017, 6:00pm UTC](https://forum.dynamobim.com/t/dictionaries-again/10818/2 "2017-04-04T18:00:05Z")

</div>

You cant output dictionaries from Python nodes. Its not supported and a known issue. You could simply return the values and the keys as sublists

> <https://github.com/DynamoDS/Dynamo/issues/3100>

---

<div class="post-metadata">

**Author:** ![Adrian\_Crisan](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@Adrian\_Crisan](https://forum.dynamobim.com/u/Adrian_Crisan)\
**Post date:** [April 4, 2017, 8:19pm UTC](https://forum.dynamobim.com/t/dictionaries-again/10818/3 "2017-04-04T20:19:33Z")

</div>

@Thomas_Mahon - thanks. I knew about that issue, but I was hoping somebody had fixed it (or explain clearly why it’s not working)  
Too bad that I cannot use dictionaries, as performing fast lookups for large datasets was something very good to have inside pynodes.  
Yes, I can pull the values and indexes in separate lists in this case and select via a lambda, though in other projects I have to export via .csv and use Pandas/NumPy.  
Thanks for your help!

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [April 5, 2017, 4:48pm UTC](https://forum.dynamobim.com/t/dictionaries-again/10818/4 "2017-04-05T16:48:42Z")

</div>

You cannot OUTPUT dictionaries. That doesn’t mean you cannot use them in Python nodes. It’s fine to use them, it will just fail when you pass it a dictionary to the OUT variable. That makes debugging a little weird, but it’s very possible.

---

<div class="post-metadata">

**Author:** ![Mostafa\_El\_Ayoubi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mostafa_el_ayoubi/32/7815_2.png) [@Mostafa\_El\_Ayoubi](https://forum.dynamobim.com/u/Mostafa_El_Ayoubi)\
**Post date:** [April 5, 2017, 5:46pm UTC](https://forum.dynamobim.com/t/dictionaries-again/10818/5 "2017-04-05T17:46:01Z")

</div>

@Adrian_Crisan  
As a workaround you can create a class that behaves likes a dictionary. This will allow you to output it and exploit it in another python node :

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/1/51d0f1f5b5858869d0bd466c1914ee401571069a.png)
