•1 min read•from Machine Learning
"colss" a math-style expression evaluator for NumPy arrays [P]
Built a small Python library called "colss" that lets you write NumPy expressions using a shorter, more mathematical syntax.
Built using C++, OpenMP, pybind11, ExprTk, and NumPy.
Github: https://github.com/SivaPA08/colss
Example:
a = np.array([1,2,3,4]) b = np.array([4,5,6,7]) c = 2 res = colss.query("sin(a+b) + log(b)^c + 12") It supports:
- logical expressions
- arithmetic operations
- ternary operators
- conditional expressions
Example:
a = np.array([1,2,3,4]) res = colss.query("a > 2 ? sqrt(a) : log(a+1)") res = colss.query("if( a>b , a+1 , b-1 )") Compared to plain NumPy syntax, the goal is mainly:
- shorter expressions
- math-like notation
- improved readability for larger and complex formulas
Still early-stage and looking for suggestions/feedback.
[link] [comments]
Want to read more?
Check out the full article on the original site
Tagged with
#rows.com
#no-code spreadsheet solutions
#natural language processing for spreadsheets
#generative AI for data analysis
#Excel alternatives for data analysis
#colss
#NumPy
#Python
#expression evaluator
#C++
#shorter expressions
#math-like notation
#improved readability
#OpenMP
#pybind11
#logical expressions
#arithmetic operations
#ternary operators
#conditional expressions
#ExprTk