Re:SymPy: Symbolic Mathematics in Python
by staplung on Wednesday February 28, 2024 @11:28AM
(#39540157)
Might not handle exactly the difficulties you're having but you can do
`from sympy.abc import *`. This will create symbols for pretty much all letters (lower and upper) as well as a bunch of greek symbols (but written out, e.g. "delta").
[ Parent
| on HN ]
Re:SymPy: Symbolic Mathematics in Python
by bloaf on Wednesday February 28, 2024 @11:49AM
(#39540543)
Imagine a scenario where you've got a database of timeseries data, say stock prices. Each price trend is identified by the stock ticker, and your users have an excel spreadsheet of several thousand equations in terms of the stock ticker (e.g. (AAPL-TSLA)/AAPL) and you want to calculate the derivative of each one of those equations with respect to each ticker symbol in each equation before pulling the data.
Obviously you could find a list of every ticker symbol and create a few thousand symbols before parsing, but you don't always have the luxury of a complete/up-to-date list, or doing so might create too many symbol objects and cause performance problems.