4 ms·
integer division JUST KILLS Python for scientific computing, it introduces the most disgusting silent errors everywhere. And the visualization functions general
by ninjaa 18y ago
integer division JUST KILLS Python for scientific computing, it introduces the most disgusting silent errors everywhere. And the visualization functions generally suck compared to the handy plot() of Matlab.
Still, Py handily beats other free alternatives to Matlab
- schtog 18y agoWhat do you mean with silent errors? Like float representation? I find matplotlib to very easy to use and creates beautiful plots but I haven't tried Matlab so can't compare obv.
- wstein 18y agoTwo comments about this: 1. In Python 3.0, integer division will return a float, e.g., 1/3 will be 0.3333... At Scipy 2006, Guido explicitly stated in his keynote talk that the design choice he made in Python (i.e., that n/m is floor(n/m)) was a mistake. 2. In Sage (http://sagemath.org http://sagemath.org), which is built on Python, we do some very minimal preparsing of input, so that 1/3 is the exact rational number 1/3 (instead of Python's stupid 1/3 == 0). We also replace, e.g., 2^3 by 23. Sage is does a lot of exact symbolic and high precision arithmetic, so 1/3 staying the rational 1/3 makes sense as the default (though one can easily change this). Disclaimer: I started the Sage project.