1 min readfrom Machine Learning

"colss" a math-style expression evaluator for NumPy arrays [P]

Our take

Introducing **colss**, a streamlined Python library designed to simplify the evaluation of mathematical expressions for NumPy arrays. By leveraging a more compact and math-inspired syntax, colss allows users to write complex queries with enhanced readability. Built using C++, OpenMP, pybind11, and ExprTk, colss supports logical expressions, arithmetic operations, and conditional statements, making it a powerful tool for data manipulation. Join us in transforming your data experience with concise and intuitive expressions. Explore colss on GitHub: https://github.com/SivaPA08/colss. Your feedback is welcome as we

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.

submitted by /u/sivpsd
[link] [comments]

Read on the original site

Open the publisher's page for the full experience

View original article

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
"colss" a math-style expression evaluator for NumPy arrays [P] | Beyond Market Intelligence