6 ms·
A book to learn R and Python in parallel for Data Science
- dajohnson89 7y agoThis is an interesting concept. It makes perfect sense to learn both simultaneously. On the other hand, it must be confusing at times. Imagine learning two languages at the same time, from the same book. It's an experiment I haven't tried, but i'm curious about the outcome.
- tyingq 7y agoAlso interesting to learn two languages, in parallel, where neither is particularly good at parallelism :)
- rpier001 7y agoAre you trolling right now? R's idioms for parallelism are pretty darn straightforward and easy to use. Effective too.
- nurettin 7y agoHumans are very good at doing things successively and calling it parallel.
- hjk05 7y agoWhat makes you think R or Python are bad at parallelism? My experience is that both are very decent.
- wisty 7y agoI suspect a lot of readers will have some proficiency in either R or Python and want to learn the other.
- h4t 7y agoI taught myself python by converting ruby programs using ruby syntax, coding styles, libraries etc. I just used the pick-axe book as a reference and converted code examples from any interesting and/or useful/relevant python source I could get my hands on at the time. (circa 2008?) So this actually makes sense to me learning 2 languages at once as long as you understand what you are doing with them to begin with. I would not recommend it to a beginner though. Interesting though. See it through and complete it. I'll check back.
- cwyers 7y agoNobody would write R code the way this book is teaching. For that matter, nobody looking to do linear regression for data science in Python is doing their own matrix math, either.
- minimaxir 7y agoA lot of MOOCs teach matrix algebra that way, which I admit I'm not fond of.
- conjectures 7y agoLinear regression should be regarded as the statistical equivalent of stripping down a rifle, reassembling it and checking its function. If you develop any statistical software, you're going to end up doing it at some point.
- awestley 7y agoI picture the author as an early-to-mid 20-year old that is great on the data sci side but weak as a developer. Considers "having to learn" python or R as a hurdle to their accessing their innate mathematical prowess.
- purple-again 7y agoLiterally the second sentence in the book he states he was an undergrad in 2006.
- cttet 7y agoI learnt Matlab/R/Python/Javascript altogether. It was a mess for me to grok all the similar-but-different syntax, but it make me realized more about the real essence of what is really important for the domain rather than language details.
- master_yoda_1 7y agoBut why? If you would never join NASA then why train to be an astronaut. Do something useful in life.
- purple-again 7y agoI read a good portion of the first chapter and skimmed the rest. I am very much enjoying this book and hope that you continue to write more chapters.
- zelda_1 7y agothanks! I'm planning to add a few more chapters.
- billfruit 7y agoI sometimes wonder is there any reason to learn R at all, since python eco system has absorbed most of its advanced statistical functionality, coupled with the factor that python environment is much more general, with capabilities to fetch, decode/encoded data,work with binary data databases, web frameworks for presenting etc.
- anthony_doan 7y ago> since python eco system has absorbed most of its advanced statistical functionality This isn't true at all... Also all advance statistical books are either SAS or R. If it's R then there is always a package that the author created. Just look at Chapman & Hall/CRC or Springer publisher and look at their books. Go here: https://www.jstatsoft.org/index https://www.jstatsoft.org/index Count the number of R packages in those papers versus Python. I don't even need a source. I'm a statistician and I'm going to get a paper there and publish a R package for my master thesis.
- minimaxir 7y agoI use both Python and R. tidyverse/ggplot2 alone are enough reason to use R, and are substantially faster for tasks that utilize those packages than the equivalent in Python (in my opinion). Although I haven't had as much reason to use base R. For more ML-related tasks I do go back to Python.
- logjammin 7y agoSeconded on all points. I do branch out to SQL for stuff, too, and I find that R and Python play nicely with it, too. But as long as ggplot exists and Python doesn't have it, R will never really leave my side.
- jwilbs 7y agoThis. I’ve contributed code to popular libraries in both languages, and while I (overall) have a preference for python (mostly due to it being general purpose), I find R code unparalleled when it comes to raw data manipulation/analysis. The overall api of tidyverse packages is such a joy, and recent improvements in purrr/tidyr allow me to construct nested data analysis workflows I couldn’t even dream of in python.
- starpilot 7y agoPython and Julia might make more sense today.
- demirev 7y agoIs Julia actually used that much? I've been hearing people herald it as the next big thing for the last five years or so, but it doesn't seem like it has taken off. I personally don't know anybody who uses it professionally (I know plenty of people who use R professionally). The most recent SO survey also indicates that it is rather unpopular.
- ddragon 7y agoJulia just got to 1.0 last year, and it does have areas where it's already between the best options in scientific computing such as differential equations solving and mathematical optimization. Regardless of not being the most popular (against the behemoths that have many times it's age and support), you shouldn't have trouble doing most stuff with it from machine learning to statistics. And it's a pretty fun and fairly unique language to learn and use.
- Y_Y 7y agoHow come there's no source in the git repo? You shouldn't just throw up the PDF and call it a day, github isn't just a trendy file host.
- mh12345 7y agoR has a nice web development framework called Shiny. While it is not comparable to say Django or Flask, Shiny does make it incredibly easy to share data analysis. If one wants to share statistical analysis or create a data oriented dashboard, then there is definitely a reason to consider R and Shiny. Note that Python has Dash, which is comparable to Shiny, but it is less mature as far as I know. While previously Shiny was primarily deployed through RStudio's solutions, there are now open source initiatives such as ShinyProxy, introducing Kubernetes as an option for deploying Shiny applications. The latest iterations of Shiny related libraries are facilitating automated testing and deployment. These developments allow companies to use Shiny in production, but it has to be said that the R ecosystem is not as developed as Python's from a traditional software development perspective.
- yboris 7y agoI learned some R just so I could try out Shiny earlier -- Shiny is pretty awesome! By Dash for Python, you mean the one from Plotly? https://plot.ly/products/dash/ https://plot.ly/products/dash/ Thank you for sharing ShinyProxy!
- mh12345 7y agoIndeed, the one from Plotly! I gave Dash a quick shot about a year ago, it worked quite well to generate interactive reports. ShinyProxy is amazing. It is pretty easy to setup, but does require quite some specialized knowledge compared to the RStudio solutions.
- mettamage 7y agoThis is one of the most fun comments I have read in a while: learn a bit of a language to check out the web dev framework behind it. Awesome!
- eoinmurray92 7y agoDash by plotly is also amazing its like shiny but for python! - we were able to whip together an app that would let you drag and drop xyyy data and get a scatter plot instantly - you can try it here (first load takes 1-2s): https://dash-app-dx9g2r0la6-8000.cloud.kyso.io https://dash-app-dx9g2r0la6-8000.cloud.kyso.io It was also really easy to make it, maybe 250 lines of python in total (guide to making this app is here: https://kyso.io/KyleOS/creating-an-interactive-application-using-plotlys-dash https://kyso.io/KyleOS/creating-an-interactive-application-u...)
- jamisteven 7y agoI feel like ever book ive ever read, on any programming language, makes me immediately want to pound my head into my desk. Nothing against the author, its just so clear that as it pertains to programming, being good at programming, and the teaching of it never come hand in hand. Same goes for real life, some of the best data scientists I work with, cant for the life of them explain concepts, and then the ones who are great at explaining it, can rarely execute with the same eloquence.
- stevewodil 7y agoThis is true for a lot of things! For example, the famous artists that perform the music on stage (nowadays, at least) likely didn't write the song they are singing. Teaching and executing are two separate skills. Fun little anecdote, in high school I had this AWFUL science teacher. He would literally just have us watch Crash Course videos to get the concepts. Turns out he was a relatively distinguished scientist himself..
- photon_lines 7y agoNice work!!! If anyone is interested, I also made a 'Learn R by Example' project which attempts to teach R through code comments: https://github.com/photonlines/Learn-R-by-Example https://github.com/photonlines/Learn-R-by-Example
- Lanrei 7y agoShouldn't '<-' be used instead of '=' for variable assignments, as they aren't the same thing in R.
- _Wintermute 7y agoIt's a large source of bike-shedding in the R community but out of the 5 assignment operators in R, those two are largely the same. There's a good explanation here: https://stackoverflow.com/questions/1741820/what-are-the-differences-between-and-in-r#51564252 https://stackoverflow.com/questions/1741820/what-are-the-dif...
- tylermw 7y agoThey are the same thing, minus the corner case of assignment within a function call: e.g. divide = function(x, y) { return(x/y) } divide(y = 2, x = 1) divide(y <- 1, x <- 2) These two calls give the same result, as the second results in assignment and then passing the argument by position. Other than this case, they are exactly interchangeable.
- samt430 7y agoApart from the odd library I have rarely found much benefit to using both languages for DS as you end up expressing the same paradigms just in different syntax. And I think for good reason too - the basis of the tools used to do data science arent in the languages themselves but the packages built for the task which is why there's often an R equivalent of a Python package and vice versa. So in effect almost no one 'uses' R/Python for DS as much as Rube-Goldberg highly-optimised compiled libraries together using different syntax.ie dplyr/pandas/scipy/ggplot etc are the real stars of the show. Rather than R vs Python I hope one of two things happen. Either both languages get replaced by a 'better' ML language eg Swift / Julia giving us users a 'turtles all the way down' experience and removing the reliance on complied packages. Or, second option, they get relegated even further into being nothing but glue between some common data formats specific to the type of work found in DS allowing you the user basically a choice between syntactic-sugar of one glue-language versus the other. Something like Apache Arrow springs to mind but I'm not sure where they are at the moment