Questions tagged [numexpr]

Numexpr is a fast numerical expression evaluator for NumPy.

Numexpr is a fast numerical expression evaluator for NumPy. With it, expressions that operate on arrays (like 3*a+4*b) are accelerated and use less memory than doing the same calculation in Python.

In addition, its multi-threaded capabilities can make use of all your cores, which may accelerate computations, most specially if they are not memory-bounded (e.g. those using transcendental functions).

Last but not least, numexpr can make use of Intel's VML (Vector Math Library, normally integrated in its Math Kernel Library, or MKL). This allows further acceleration of transcendent expressions.

Numexpr User Guide lists the functionalities supported by it alongwith other useful info related to it.

94 questions
0
votes
1 answer

Issues when applying a mathematical operation to a column of a pandas dataframe

In Jupyter Notebook, I am trying to divide a column of a dataframe by 10, but this is the error that I am getting: import pandas as pd df = pd.DataFrame({'A':[20, 20.25], 'B':[70, 41]}) df['A'] = df['A']/10 8 try: 9 import numexpr…
Antarqui
  • 467
  • 6
  • 18
0
votes
0 answers

ImportError: Can't determine version for numexpr

I am getting this error after I am running: (100*df.isna().sum()/df.shape[0]).round(1) I use Jupyter (Anaconda). This is the full error i get: --------------------------------------------------------------------------- ImportError …
Amit S
  • 225
  • 6
  • 16
0
votes
0 answers

How to make numxepr operate with complex64?

I am trying to execute this code: import numpy as np import numexpr as ne def julia(h, w, maxit=20, a=0.0): x = np.linspace(-1.8, 1.8, w, dtype=np.float32) y = np.linspace(-1.8, 1.8, h, dtype=np.float32) xv, yv = np.meshgrid(x, y) c…
0
votes
1 answer

Function not returning proper value, Is there anything missing

When executing a expression with eval(), the output for some input is wrong. I think the decimal values are not considered. I have been trying to evaluate a string with python eval() and also tried numexpr() def _calc_line_base_amount(text): …
SREEJITH
  • 78
  • 14
0
votes
0 answers

how can i make a string comparision using numexpr evaluate? not df.eval

I'm trying to use Numexpr to make a filter.when i trying to run the next code snippet: >>> import pandas as pd >>> import numexpr >>> df=pd.DataFrame({'a':[1,2,3],'b':['one','two','three']}) >>> df a b 0 1 one 1 2 two 2 3 three >>>…
0
votes
2 answers

How can I speed up the performance by using numpy einsum and numexpr in calculating kernel functions?

I am trying to define a few of famous kernels like RBF, hyperbolic tangent, Fourier and etc for svm.SVR method in sklearn library. I started working on rbf (I know there's a default kernel in svm for rbf but I need to define one to be able to…
Masoud Masoumi Moghadam
  • 1,094
  • 3
  • 23
  • 45
0
votes
1 answer

Python 3.X: Why numexpr.evaluate() slower than eval()?

The purpose of using the numexpr.evaluate() is to speed up the compute. But im my case it wokrs even slower than numpy und eval(). I would like to know why? code as example: import datetime import numpy as np import numexpr as ne expr =…
sun0727
  • 374
  • 4
  • 19
0
votes
1 answer

numexpr, check for the presence of VML

There are many different Python distributions that allow for the installation of complementary modules, sometimes using different tools so that, when one installs a new package, it's not always immediately apparent how the package was built. A…
gboffi
  • 22,939
  • 8
  • 54
  • 85
0
votes
1 answer

Heavy computations in analytic functions and linear algebra

For non-standard computations in optical wavefront propagation I need to deal with very large matrices (about 10^6*10^6 entries) which are not sparse or in any way "reducible". The code roughly reads as follows: import numpy as np x =…
phlegmax
  • 419
  • 1
  • 4
  • 11
0
votes
1 answer

import xlwings, missing files from numexpr package

I'm trying to get started with xlwings, but am recieving a few errors when I go to import it. I pulled up my OSX terminal, ran pip install xlwings no problem there. Fired up python $ python then ran import xlwings as xw And it gave me…
Joshua Zastrow
  • 1,355
  • 4
  • 17
  • 32
0
votes
0 answers

Numexpr for Python returning all zero arrays on certain hardware configurations

I've recently discovered what appears to be a bug in Numexpr. Although I've already opened an issue on their Git hub, I figured I would avail myself of the collective wisdom here as well. In a nutshell, evaluate sometimes (unpredictably) returns…
Trekkie
  • 964
  • 1
  • 9
  • 32
0
votes
1 answer

having problems installing pytables

I'm trying to install pytable, but first i must install numpy and numexpr to my windows 7 machine, I tried to install numexpr-2.2.2 an this is what happen Warning: Assuming default configuration (numexpr\tests/{setup_tests,setup}.py was not…
dmb
  • 35
  • 1
  • 1
  • 3
0
votes
0 answers

Pandas: inverting query string produces invalid results

I am trying to wrap my mind around some unexpected behaviour of pandas dataframe query method: Assuming a test dataframe: >>> df = pd.DataFrame([[1,1,1,2,2,2],[1,2,3,4,5,6]], columns=['a', 'b', 'c', 'd', 'e', 'f']) >>> df a b c d e f 0 1 1…
ARF
  • 7,420
  • 8
  • 45
  • 72
0
votes
2 answers

Selecting with query where conditions are met for all columns

Say I have a dataframe in Pandas consisting of several columns. I would like to select the subset of the dataframe where all columns are between two values min and max. How can I do this using query? Do I need to specify every column name one by one…
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
0
votes
0 answers

Turning a python project to exe with py2exe

I'm trying to turn a python project to exe but I get this problem when running the .exe file: Traceback (most recent call last): File "fiveopoker.py", line 4, in File "agents.pyc", line 10, in File "probTable.pyc", line 3, in…
ifryed
  • 605
  • 9
  • 21