# StdDev not working

**URL:** <https://forum.inductiveautomation.com/t/stddev-not-working/18333>\
**Category:** General Discussion\
**Created:** [June 6, 2018, 7:24pm UTC](https://forum.inductiveautomation.com/t/stddev-not-working/18333 "2018-06-06T19:24:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pcharles](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@pcharles](https://forum.inductiveautomation.com/u/pcharles)\
**Post date:** [June 6, 2018, 7:24pm UTC](https://forum.inductiveautomation.com/t/stddev-not-working/18333/1 "2018-06-06T19:24:55Z")

</div>

this is the error -

raceback (most recent call last):  
File “”, line 5, in   
File “”, line 10, in stdDev  
AttributeError: type object ‘org.python.modules.math’ has no attribute ‘stdDev’

code:  
import math

array=[1.0,2.4,5.6]

print stdDev(array)

I’ve also tried with  
print math.stdDev(array)

and simply stdDev(array) without importing math

according to this: [https://docs.inductiveautomation.com/display/DOC79/stdDev](https://docs.inductiveautomation.com/display/DOC79/stdDev)

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [June 6, 2018, 7:27pm UTC](https://forum.inductiveautomation.com/t/stddev-not-working/18333/2 "2018-06-06T19:27:16Z")

</div>

stdDev is an expression function, not a scripting function

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [June 6, 2018, 7:28pm UTC](https://forum.inductiveautomation.com/t/stddev-not-working/18333/3 "2018-06-06T19:28:59Z")

</div>

Are you trying to use the new scripting functions? In that case, you want to use system.math.standardDeviation() [docs](https://docs.inductiveautomation.com/display/DOC79/system.math.standardDeviation)

The doc you linked to is from the expression language, which is not available in scripts, as bfuson said.

---

<div class="post-metadata">

**Author:** ![pcharles](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@pcharles](https://forum.inductiveautomation.com/u/pcharles)\
**Post date:** [June 6, 2018, 7:37pm UTC](https://forum.inductiveautomation.com/t/stddev-not-working/18333/4 "2018-06-06T19:37:23Z")

</div>

That works, Thank you @KathyApplebaum!!
