# Numpy for python script

**URL:** <https://forum.dynamobim.com/t/numpy-for-python-script/5394>\
**Category:** Developers\
**Created:** [August 2, 2016, 5:33pm UTC](https://forum.dynamobim.com/t/numpy-for-python-script/5394 "2016-08-02T17:33:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![JParker](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@JParker](https://forum.dynamobim.com/u/JParker)\
**Post date:** [August 2, 2016, 5:33pm UTC](https://forum.dynamobim.com/t/numpy-for-python-script/5394/1 "2016-08-02T17:33:12Z")

</div>

Hello all,  
I’m a newbie to both python and dynamo, so bear with me. I’m trying to write a script for some basic matrix analysis in python, but I’ve been unable to use functions like zeros and transpose because I haven’t found a way to numpy to work in my python script. It seems like numpy is what I need to download (although I can’t get it to work), but I’d be happy to hear if there are suggestions for any other options for working with arrays. What I’m doing requires some matrix analysis and for loops.  
Thanks,  
Jared

---

<div class="post-metadata">

**Author:** ![Dimitar\_Venkov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dimitar_venkov/32/2068_2.png) [@Dimitar\_Venkov](https://forum.dynamobim.com/u/Dimitar_Venkov)\
**Post date:** [August 3, 2016, 2:15am UTC](https://forum.dynamobim.com/t/numpy-for-python-script/5394/2 "2016-08-03T02:15:51Z")

</div>

numpy is intended for use with Cpython. Dynamo uses the .Net based ironPython implementation and thus does not support numpy. You can try using [Math.Net](http://Math.Net) instead. I don’t believe there are any examples for it on the forum but this link should get you started:

> **[Using Math.NET Numerics in GhPython](http://www.grasshopper3d.com/profiles/blogs/using-math-net-numerics-in-ghpython)**
>
> Hi all,
> some users reported that it is increasingly difficult to get access to numpy/scipy in IronPython on a 64-bit machine. It used to be simple on a 32-bit…

---

<div class="post-metadata">

**Author:** ![Tomasz\_Puchala](https://avatars.discourse-cdn.com/v4/letter/t/5f9b8f/32.png) [@Tomasz\_Puchala](https://forum.dynamobim.com/u/Tomasz_Puchala)\
**Post date:** [August 3, 2016, 7:22am UTC](https://forum.dynamobim.com/t/numpy-for-python-script/5394/3 "2016-08-03T07:22:44Z")

</div>

Could you upload sth to work on? What do you want to achieve?

---

<div class="post-metadata">

**Author:** ![JParker](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@JParker](https://forum.dynamobim.com/u/JParker)\
**Post date:** [August 3, 2016, 4:17pm UTC](https://forum.dynamobim.com/t/numpy-for-python-script/5394/4 "2016-08-03T16:17:30Z")

</div>

Hey Tomas,  
Thanks for the reply. I am trying to do an optimization (using Optimo which has been successful for simpler problems) of the beams and columns for a multi-story and multi-bay moment frame, having cross-sections and bay width as my variables. Roof deflection and structure weight are my objectives. I have many codes in Matlab that will do the analysis, and that is where I was hoping to write a python script that will do the same thing as my Matlab scripts. This is only because I have not been able to link Dynamo and SAP2000 through DynamoSAP.

---

<div class="post-metadata">

**Author:** ![JParker](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@JParker](https://forum.dynamobim.com/u/JParker)\
**Post date:** [August 3, 2016, 4:21pm UTC](https://forum.dynamobim.com/t/numpy-for-python-script/5394/5 "2016-08-03T16:21:05Z")

</div>

Dimitar,  
Thanks for the response. I have tried using the [Math.Net](http://Math.Net) method from the link, but I cannot seem to figure out how to install it to the Dynamo IronPython script. I saw a link on enthought that has a package that is supposed to add numpy and scipy to IronPython. It is [https://store.enthought.com/repo/.iron/](https://store.enthought.com/repo/.iron/), but it only opens if you’re signed in as a member. I also haven’t been able to add it to the IronPython script in Dynamo.

---

<div class="post-metadata">

**Author:** ![Michal\_Dengusiak](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/michal_dengusiak/32/92831_2.png) [@Michal\_Dengusiak](https://forum.dynamobim.com/u/Michal_Dengusiak)\
**Post date:** [December 5, 2016, 2:56pm UTC](https://forum.dynamobim.com/t/numpy-for-python-script/5394/6 "2016-12-05T14:56:55Z")

</div>

I am wandering if this could help.  
It looks it might be possible I would be interested to hear if anyone succeed.

> <https://stackoverflow.com/questions/29397540/how-to-install-numpy-and-scipy-for-ironpython27-old-method-doenst-work>

---

<div class="post-metadata">

**Author:** ![adi](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@adi](https://forum.dynamobim.com/u/adi)\
**Post date:** [July 18, 2017, 2:07pm UTC](https://forum.dynamobim.com/t/numpy-for-python-script/5394/7 "2017-07-18T14:07:37Z")

</div>

@JParker did you figure out a solution? I am trying to do the same.

---

<div class="post-metadata">

**Author:** ![Michal\_Dengusiak](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/michal_dengusiak/32/92831_2.png) [@Michal\_Dengusiak](https://forum.dynamobim.com/u/Michal_Dengusiak)\
**Post date:** [August 4, 2017, 9:22pm UTC](https://forum.dynamobim.com/t/numpy-for-python-script/5394/8 "2017-08-04T21:22:05Z")

</div>

Not yet…

---

<div class="post-metadata">

**Author:** ![xiuchengyang](https://avatars.discourse-cdn.com/v4/letter/x/c57346/32.png) [@xiuchengyang](https://forum.dynamobim.com/u/xiuchengyang)\
**Post date:** [December 12, 2017, 8:19am UTC](https://forum.dynamobim.com/t/numpy-for-python-script/5394/9 "2017-12-12T08:19:44Z")

</div>

I am also expecting a solution,
