We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fdd303 commit 3ad175dCopy full SHA for 3ad175d
numexpr/numexpr_minimal.py
@@ -0,0 +1,20 @@
1
+""" Getting started with numexpression
2
+"""
3
+
4
+import numpy as np
5
+from numexpr import evaluate
6
7
+N = 8
8
+a = np.arange(10**N)
9
+b = np.arange(10**N)
10
+# Numpy version
11
+c1 = 2*a**3+b**2+16
12
+# Numexpr version
13
+c2 = evaluate("2*a**3+b**2+16")
14
15
+# Exploring the other available operators
16
+a = np.random.random((1000,1000))
17
+d = evaluate("sum(a, axis=0)")
18
+print "The sum of all elements:", d
19
+e = evaluate("log(a)")
20
+print "The log of all elements:", e
pytables/numexpr_minimal.py
0 commit comments