Thursday, June 16, 2022

Parsing Formula with Python

For simple formula parsing, we can make use of ast package in Python. It builds the abstract syntax tree and we can recursively traverse it. Here is an example how to convert the formula in a structured dictionary.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
view raw ast.ipynb hosted with ❤ by GitHub

No comments: