4 ms·
What advantages does Python have over R for basic statistics work? I’m trying to play with data for fantasy sports and was planning on getting the data into a M
by jareds 13y ago
What advantages does Python have over R for basic statistics work? I’m trying to play with data for fantasy sports and was planning on getting the data into a MySQL database then using R to look for patterns. Is R the right choice for this, or is it a matter of both Python and R being able to the same thing in different ways so there is no wrong choice? Given the fact that it will be a fairly small dataset I’m not overly worried about performance.
- dlib 13y agoNo wrong choice I think, mostly personal preference. If you know Python I'd stick with that, iPython notebooks with pandas etc. is a solid choice. R might be a little harder to start with, sapply/lapply can be confusing but there's plenty of info and libraries on the web to make your life easier. For plotting, ggplot still wins over matplotlib in my opinion but Python has other strengths.
- keypusher 13y agohttps://pypi.python.org/pypi/ggplot/0.4.7 https://pypi.python.org/pypi/ggplot/0.4.7
- keypusher 13y agoOne of the big differences is that Python is a general purpose programming language, which just happens to have great support for statistics through packages. That means interfacing with a database is a very common workflow, and there are solid tools to do so like sqlalchemy. Now let's say you you want to calculate all this data and serve it on a webpage. R kind of falls over at this point. Python? No problem, you can start up a Flask webserver in half a dozen lines of code and have your data visible to all your fantasy team friends. Oh, you want to pull down the live data from the web, parse it from html/xml/csv, analyze it, put it into the database, and spit out the new analysis in realtime on your webpage? Python has you covered. R, not so much. To me Python also feels much more robust and well thought out as a language, but that could just be personal prejudice.
- sampo 13y ago> "What advantages does Python have over R for basic statistics work?" The advantage of Python is that it's a nice, well designed general purpose programming language. But in basic statistics work you don't need to develop large, well organized programs, so in practice I'd say there is no advantage. R provides a larger collection of all kind of statistical routines out of the box.