Earlier quoted context omitted.
Let's not pretend math notation has remained constant for millennia.
Exactly, it has been refined over millennia.
Doing Symbolic Math with SymPy
31–40 of 81 posts
Re: Doing Symbolic Math with SymPy
#32[1] - https://github.com/JuliaPy/SymPy.jl
Re: Doing Symbolic Math with SymPy
#33Earlier quoted context omitted.
It runs on a google colab tab that you can spin up pressing "ctrl-T" in any available computer.
Sure, but if you want fast easy math, it's hard to beat wolfram alpha, where you can just enter something like "solve x^2+5a=y for x" and get the answer right away.
Last time I used sympy I had a complicated function on many variables and wanted to plot certain specific 2D contours. I was distant from any computer with numerical/programming tools and needed to add them to a PPT deck last minute.
Re: Doing Symbolic Math with SymPy
#34Worth noting that Julia's SymPy binding [1] is pretty pretty nice to work with too. If anyone's looking for big Julia project, I think a symbolic math package written fully in Julia would be a really exciting development. As far as I know, there isn't one yet. The better-known symbolic math packages for Julia still use bindings to C++ (SymEngine.jl [2]) or Python (SymPy.jl, Symata.jl [3]). [1] - https://github.com/Ju…
https://github.com/SciML/ModelingToolkit.jl
https://mtk.sciml.ai/dev/tutorials/symbolic_functions/
It's more like SymEngine in terms of completeness right now, though there's a good amount of simplification and equation solving built in. It's still growing, it's not at SymPy yet, but it's moving fast.
Re: Doing Symbolic Math with SymPy
#35One of the coolest things about SymPy is the Live Shell, that let's you try basic calculations (without plotting) in the browser: https://live.sympy.org
There is even an option to send the entire session encoded as URL querystring which makes it tweetable, emailable, etc. e.g. https://live.sympy.org/?evaluate=factor(x**2%2B5*x%2B6)%0A%2... (to generate the session-as-querystring for your current live.sympy.org session, use the thumbtack button below the prompt)
I use this very often to send calculations and solutions—not only do you get the answer, but you see all the calculations.
Re: Doing Symbolic Math with SymPy
#36Re: Doing Symbolic Math with SymPy
#37+100 this; SymPy is the best! One of the coolest things about SymPy is the Live Shell, that let's you try basic calculations (without plotting) in the browser: https://live.sympy.org There is even an option to send the entire session encoded as URL querystring which makes it tweetable, emailable, etc. e.g. https://live.sympy.org/?evaluate=factor(x**2%2B5*x%2B6)%0A%2... (to generate the session-as-querystring for your…
Re: Doing Symbolic Math with SymPy
#38SymPy's problem is that it is based on an object-oriented language. This results in SymPy (and friends) demanding that users abandon hundreds of years of math notation, to conform to the whims of a programming language. In SymPy you do M.diagonalize(), which makes no sense. The matrix M does not have a property diagonalize. Rather, you should apply a choosen diagonalization algorithm like Diagonalize(M) to produce a…
This is problem I have with Python in general; that even if you prefer to use it in a functional style, most libraries are written by real Python programmers, and using them will force you to grapple with the object-oriented inversion of common sense ( https://lee-phillips.org/pythonhate/ ). My favorite example is: ','.join(['a', 'b'])
> My favorite example is: ','.join(['a', 'b'])
I've always found the discrepancy between this example (instance method call), list(('a', 'b')) (technically a method call, but resembles a functional call), and str.lower('AB') (class method call) to be quite maddening.
Re: Doing Symbolic Math with SymPy
#39Earlier quoted context omitted.
What's wrong with (','.join(['a', 'b']))? If it's the order of arguments, then I want to point out that the order has two big advantages: * partial application is actually useful: I've actually used (','.join) before, but (lambda sep: sep.join(['a', 'b'])) seems relatively useless. That's why Haskell also uses this order with (intercalate sep listOfStrings). * it accepts any iterable, rather than just lists.
What strikes me as weird about this is that our intent is to do something to the array of strings, so we are looking for a function that takes this array and transforms it into something else. But we are obligated to invert our intuition here, and write this as if we are doing something to the punctuation that we want to insert between the array elements. It’s backwards, and causes us (me, anyway) to keep forgetting…
Well, 'hello'.join(', ') does not produce the same output as ', '.join('hello'), so the order of the arguments does matter.