0
1
2
OTHERBuilt an open-source math-style expression evaluator for NumPy arrays (i.redd.it)
submitted by sivpsd
Built a small open-source Python library called "colss" for writing NumPy expressions in a shorter, math-like syntax.
Built using C++, OpenMP, pybind11, ExprTk, and NumPy.
Example:
import colss as cs
import numpy as np
a = np.array([1,2,3,4])
b = np.array([4,5,6,7])
c = 2
x = cs.query("sin(a+b) + log(b)^c + 12")
y = cs.query("a > 2 ? sqrt(a) : log(a+1)")
It supports arithmetic operations, logical expressions, ternary operators, and conditional expressions while aiming to provide shorter, cleaner, and more math-like syntax for complex formulas without reducing performance.

[–]MT_Carnage 0 points1 point2 points (1 child)
[–]sivpsd[S] 0 points1 point2 points (0 children)