Ask HN: Learn Python, R? Or something else?
27 points| socrates1998 | 9 years ago
Should I just learn R right away? Or should I learn another programming language first (like Python), then learn R?
I have some limited experience in Web development, doing web design and building website mainly in Word Press. As such, I know a some html, css, and Php.
Just looking to see if I could learn R without knowing much else.
[+] [-] RockyMcNuts|9 years ago|reply
I'd consider doing the Stanford Statistical Learning class which starts off with teaching you R. https://lagunita.stanford.edu/courses/HumanitiesSciences/Sta...
Also recommend Swirl, which is an interactive tutorial - http://swirlstats.com/students.html
Or you can go straight to Julia, which is a modern statistical package and language without R's quirks http://julialang.org/
If you're eventually going to put your project on the Web, or just want to learn programming the right way, might be better off doing it in python.
[+] [-] phillc73|9 years ago|reply
I know a reasonable amount of R, but I don't really know any other programming language. I did once go looking at Julia, and had thought to write a few simple things using it, but in the end just ran out of time and did it with R.
Learning R has been one of the most challenging and enjoyable things I've done over the last three years. However, I would be interested to know where Python, Go or Julia would make my life better or easier.
I mostly write R scripts to analyse and graphically display interpretations of data. There are so many contributed libraries, it feels like I am really spoiled for choice.
I also write Shiny web apps. Is there a Python equivalent of Shiny? I have heard of Django, but is that really as easy as just writing a Python script and deploying on a server? I always thought Django was more of a complete framework which also required server side coding.
Anyway, I would genuinely like to know what advantage Python or Julia or Go would provide me with over just continuing with R.
[+] [-] mindcrime|9 years ago|reply
Why do I say that? First of all, R's syntax is quirky and different enough from (Python|Java|C|Ruby|etc.) that you might almost find it harder to learn R if you're already used to something else. Second, aside from the syntax the biggest thing to get used to with R is that it's very much vector oriented. Basically you're always working with vectors, even when you only have what you would otherwise think of as a single scalar value. You just put in a vector of length 1. Anyway, that whole paradigm is different enough from other programming languages, that you might as well just learn it that way from the beginning.
Now to be fair, there are libraries and things that let other languages act and feel a bit more like R, but I'm intentionally not considering those right now, as that would just be one more complication to deal with. And if you are locked in on using R for whatever reason, there's no need to complicate life.
The only other question I would have, is whether or not you absolutely must use R at all. If you have the option to choose your language, you can do pretty much anything that you can do in R, using Python, or Octave, or probably many other languages. If that's an option, then you just need to decide which would be easier / more useful for you. And while I won't take sides in general, I will say that Python may be a little bit easier to learn in general, but then you're back to using external libraries for more of the statistical / numerical stuff.
Just looking to see if I could learn R without knowing much else.
My guess is that you can. R has some quirks, but there's nothing especially scary about it. Depending on how much you already know about statistics, you may find that learning and understanding the math is more difficult than learning to use R.
[+] [-] mateo411|9 years ago|reply
If you don't know R or Python, I would say that learning Python might work out better for you. Python is a general purpose programming language, whereas R is really good at stats and visualization. Python is also pretty good at this, you can use pandas, matplotlib, and scikit-learn.
[+] [-] socrates1998|9 years ago|reply
My goal is to be able to analyze the next play and possibly give a probability attached to where the coach will call the play.
But that's just the first step. I would probably need to do a lot of different stuff with the data.
[+] [-] syntexis|9 years ago|reply
[+] [-] kasperset|9 years ago|reply
[+] [-] dec0dedab0de|9 years ago|reply
[+] [-] clumsysmurf|9 years ago|reply
Bruce Eckel had a blog about this, I think you'll find the discussion around R / Python / Mathematica interesting
http://bruceeckel.github.io/2015/02/15/why-not-go-there/
[+] [-] 77ko|9 years ago|reply
As a starter, you probably need something like dataquest[0] or udacitys[1] data courses.
[0] https://www.dataquest.io [1] www.udacity.com
[+] [-] anotheryou|9 years ago|reply
(I'm kinda decided and want to do a bit of statistcics, but also have one general purpose language I know a bit better)
[+] [-] Sir_Substance|9 years ago|reply
Python in more general purpose. If you want to do things that are not statistics in the future, python makes more sense.
If you're going to get started with python, get started with python 3.
[+] [-] unclesaamm|9 years ago|reply
[+] [-] brunosaboia|9 years ago|reply
[+] [-] unknown|9 years ago|reply
[deleted]
[+] [-] eb0la|9 years ago|reply
Using Python for data will help you learn something that can be used for more... but be warned that Dataframes on stuff like Spark don't work with list comprehensions (my favorite Python feature).
[+] [-] busterarm|9 years ago|reply
Fortran is always fun though. :)
[+] [-] Mikeb85|9 years ago|reply
[+] [-] jonbaer|9 years ago|reply
[+] [-] probinso|9 years ago|reply