Skip to content

Commit 3ad175d

Browse files
author
Jonathan Rocher
committed
Moved numexpr minimal file into numexpr folder
1 parent 3fdd303 commit 3ad175d

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

numexpr/numexpr_minimal.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)