#70 Beyond the Language Wars: R & Python for the Modern Data Scientist
6 Sept 2021 · 56 min
Rick Scavetta and Bojan Angelov, authors of Python and R for the Modern Data Scientist, argue that R's strength is its statistics-first community and visualization tools like ggplot2, while Python excels at data engineering and web deployment. They recommend beginners focus on problem-solving first, learn by doing, and pick up a second language later.
Chapters
Hi, I'm Maggie, VP of Curriculum at datacamp, and I know firsthand how overwhelming it can be to keep up with the rapid changes in data and AI. But staying ahead doesn't have to be hard. That's why our curriculum team has curated the best learning content to help you and your team stay ahead, covering everything from data and AI literacy for busy executives to cutting edge generative AI for developers, and everything in between. Whether you're upskilling yourself or your team, we make learning practical, engaging and flexible. It just works. Power your data and AI transformation journey on datacamp.com.
Hello, this is Adele Neme from datacamp and welcome to Data Framed, a podcast covering all things data and its impact on organizations across the world. One of the most frequently asked questions I receive from folks trying to break into data science is which language to learn first, R or Python. This debate has gone through ebbs and flows for as long as I can remember, and almost every data scientist knows it as the Language Wars. However, do we really need this us versus Them paradigm? This is why I'm excited to have Rick Skiveda and Bojan Angelov on today's podcast. Rick Skiveda and Bojan Angelov are the authors of Python and R for the modern Data Scientist, the Best of both worlds. Rick is a prolific data science educator and founder of Skveta Academy and is primarily an R user. Bojan is a data strategist and is the author of Elements of Data Strategy and is primarily a Python user. In their new book, they detail the histories of R and Python, what led to the so called language wars, and chart a variety of use cases of language interoperability that shift the us versus Them paradigm on its head. Throughout the episode we discuss the history of Python and R, what led them to write the book, how Python and R can be interoperable, how the advantages of each language, when where to use it, how beginner data scientists should think about learning programming languages, how experienced data scientists can take to the next level by learning a language they're not necessarily comfortable with, and more if you enjoyed today's conversation with Rick and Bojan and want to check out previous episodes of the podcast and show notes, make sure to go to www.datacamp.com community podcast. Also, we'd absolutely love your feedback on how we can make Data Framed a better show for you and which guests you think we should bring on the show. I left a survey link in the episode description. Please make sure to fill it out as I'd greatly appreciate it. Rick Bojan I'm very excited to have you on the show.
Well, good morning. That'll be really nice to have us on the podcast. Thanks a lot for inviting us.
I'm excited to discuss your new book, Python and R for the Modern Data the Best of Both Worlds and how it signals the dawn of a bilingual data science community. Before we dive into the details, I want to first start off by understanding your motivations for writing the book.
Well, the motivations for the book I think are kind of a couple of different reasons that we have, and I think Bojan and I had different reasons for why we wanted to write this book. Maybe Bojan, you can start us off.
Yeah, thanks for having us. It's great to be here. I mean, for me personally, my biggest motivation behind this book will be the impression I had about the so called language wars. I'm sure we'll get a bit deeper into that a bit later. But I mean how me and Rick like to say the language war is over. And me personally, I always found it confusing that people get so focused on one tool versus the other, while in reality you should always use the best tool for the job. And from my experience with working with clients, I worked also in very different industries. I have seen that things are moving into a more tool agnostic direction where you want to use the best tool for the job and it's not as important what actually you're using. And this really motivated me and Rick to write this book.
Yeah, so I mean, the book is really about getting our users to understand Python and start using Python and the Pythonesis to start appreciating users and to look at the tools available in R. And like Warren mentioned, it's really not just about using the best tool for the job, but really appreciating the resources that are available to us. For me, it's really frustrating when scientists or any kind of technical professionals limits themselves to one way of working or one tool of working or says, okay, everything needs to be in this specific language. And just like data scientists are this large diverse group of people, the tools we have are also diverse. And why shouldn't we take advantage of all the wonderful tools and resources that we have available to us? So that, that was part of, part of it. And I think another reason is that, you know, going back to the whole language wars issues that Boyen mentioned, I was kind of over it and I really, it kind of bugs me to hear people talk about this us versus them mentality in whatever context it is. And I don't think that helps to build Any kind of community. And so I'm happy to see that people kind of getting over this, us versus them, Pythonista versus user, which is better, and kind of snubbing the nose at another attitude, which is. Which I always found kind of disgusting. And it's also a little bit about getting over that, but also having empathy for the other group. Right. So to understand why do pythonistas do things in the way that they do, what are they thinking about, what context does it work in, what are the advantages, disadvantages, and then also vice versa. Right. So can we really get into the mind of a Pythonist or the minds of a user and understand kind of where they're coming from so we can then understand how to use the tools better? So there's a little bit about empathy mix inside there as well.
That's awesome. And especially as how the book acts as a bridge builder between both communities. Can you describe the set of events that led to R and Python becoming the primary data science tools of today, and how this translates into what we call the language war between R and Python?
That's something that we talk about right at the very beginning of the book. And it's kind of a little bit unusual that we would begin a book on R and Python by giving this whole history of both of the languages. But I wanted to start the book in that way because I thought that's important to help people understand the current context and how we got to where we are. And so one of the first questions people ask when they're trying to decide, should I learn R? Should I learn Python? Is what's the difference between R and Python? And you'll see a lot of posts on Stack Overflow or different message boards, Reddit, where people talk about what are the basic differences between these languages and why should I use one versus the other? And nobody really kind of comes to a clear consensus or a clear understanding of what the difference is. And so what I tried to do in the first chapter is just outline the history of these languages to give an idea about the different ethos and how things work differently between the two languages. So R was there kind of at the very beginning of scientific computing in academia, in the late 70s, early 80s, in Bell Laboratories. And it was really developed as a programming language for doing statistical analysis. And in the book, I call it a FUBU language. So FUBU is a streetwear clothing company from New York that I used to love when I was a teenager. And it stands for for us, by us. And I like this forest bias attitude. It's very much for the community, by the community kind of ethos. And that's very much what R is. Right? It's for statisticians, by statisticians, and it's just meant to just get statistics done, get data analysis done, work with your data, just get it done. It's a programming language in its own right, but it's first and foremost used for doing data analysis. And that really shaped all of what came afterwards in R. And Python kind of comes at it from a different direction. Python originated as a generalist programming language to make just entry into programming easier, with a nice syntax and an easier access to managing all kinds of different tools and system administration and building applications and web development. So it had its fingers everywhere as a generalist programming language. And then came Data Science later on. So Python wasn't Data science first and then programming second. It was kind of the other way around. And that also it kind of affected the ethos of how data science got done in them. So when you see that Python is much more popular, part of that is due to the fact that it began life really as a popular generalist programming language. So it wanted to be everywhere, and it is everywhere. It's not always done in data science context, but it is widespread and that's why it's a little bit easier to integrate into companies using Python than using R. That's great.
The early part of the book really acts as a lay of the land and tries to introduce the R and Python universe for users of the opposing language. I think you both do an excellent job at talking about some of the benefits of each language without necessarily putting the other down as authors here, can you walk me through the challenge of drawing a fair comparison between both languages that doesn't really extend into promoting a monoculture or taking sides?
Yeah, it wasn't easy, I have to say, to compare those two things, R& Python, because as Rick suggested, they have such a different origin. I mean, you can really feel it to this day. And from the beginning, our initial idea was, yeah, can we make complete, like one to one, like, scientific way to compare them? Very quickly we realized, I mean, that's not very fair. I mean, we do go into that direction quite a bit in the book to show how exactly the same thing is done in different ways in both languages. But we try to be more focused on what do you want to achieve. It's our deep belief that you do need to first think about the problem and then about the tool, and only then you can choose the best one for the job. And this is why throughout the book we really tried to focus on use cases, different workflows, different data formats, and only then decide, okay, maybe here are those things in a bit of a different way than Python and what exactly those differences are. So our solution was really to go for the practical, for the use cases.
Yeah, I think that's a really good point that we didn't want to try and make a one to one translation between R and Python. So we have an appendix where we do talk about, okay, this is a list in R and that's a similar structure in Python and vice versa. But the point of the book was not to just help people map their knowledge of one language onto another language, but to really appreciate it and really be bilingual. And anybody that's learned a new language, a spoken language, as an adult sees that this is kind of a difficulty. You try to speak a new language using the grammar and even vocabulary of your original language, right? We have these, these false friends between many languages that sound very similar to words in your original language, but they're different, or the grammar, you want to use your original grammar in a different context and it just doesn't work. Right? So this one twin translation is not really the point. The way to kind of, kind of work between them was to really think about, about being bilingual and to think about not putting stuff into a box, but really thinking about, okay, how does each language deal with it and what's the best scenario? What's the best case for the specific tool that I need to work with here? Instead of trying to solve every problem with the one language that I have, we can expand our resources and think about, okay, well, would this be better? Is there better resources in this language to deal with this specific problem that I'm dealing with? One of Bojan's favorite analogies is the hammer and the nail. If all you have is a hammer, everything looks like a nail. I'm not a huge fan of this analogy, but it does kind of work. I will, I will, I will admit it to when it does, does work in this context, it's more, it's more like, you know, if, if you, if you only have the one tool available to you, then you're going to just be limiting yourself. I think of it as more as finite versus infinite thinking, right? If you, if you, if you only have a small set of tools, you're not going to, you're not going to think about things in creative and new ways, right? So it's not just that you try to treat every problem with the tools that you have, but it's that you're limiting your creativity, you're limiting the way that you think about things, you're limiting the way that you approach things. Right? That's the whole problem with monoculture or low diversity environments where we just limit our creativity. So part of that is changing the way people think about how the two languages relate to each other.
And maybe I can take this analogy a bit further. What we often also talk about is when you're bilingual, like in real human languages, I heard the expression somewhere that you do not think in words, you think in concepts. And it's kind of true, I mean, because you're not limited by the sounds and the meaning of just one language. And that makes you a bit more flexible in how you approach things. And one example that I often give is, for example, if I'm working with a very, very junior data scientist and they look at me searching for things with Stack overflow. I mean, obviously everybody searches for things with Stack overflow. It doesn't matter what your level. But then they wonder why I'm so fast at those things. And I would explain, it's really this idea that I think in the concept, I don't know exactly one to one what I'm looking for, but because I have seen it in a different context, I expect this to be present in the documentation. And when I see it, I immediately get it. So I think learning how to use R and Python, both of them, being bilingual, allows you to be very, very creative in solving problems. This is my impression from my work as well.
I want to expand here on the benefits of being bilingual. As a data scientist, there are so many details that we can cover, but if you had to summarize the top five features or components of the R universe that pythonista should know, what are they?
I think that R is quite distinct from Python in a number of areas that really do make it stand out. One I think is because it's a FUBU language, because it's really meant for just doing your work. It's much easier to get off the ground running with R, and that's not just because there's one very dominant IDE which many people are using, which is very well supported, but it's also because just the language itself, even if you're not using specific packages, even just using base R, it's easier to get off the ground running. I can show a complete newbie that's never seen any data analysis written out in a programming language before. I can show them R code and they can tell me what it's doing right, which is pretty, pretty impressive. So I think it's easy to get off the ground running, which is why you see it used in academia. A lot academics, they don't have the time to learn a whole new program language. They got enough stuff to do, they've got so much research and stuff to keep on top of, they just want to do their analysis and get on with their lives. And so R really facilitates that in a nice way. I think another thing that is really a massive advantage in R is the whole Markdown ecosystem. There's many packages associated with that. So there's not just R Markdown, but blog down, book down and many other packages that help with reporting. It sounds like a minor thing, but actually it's pretty massive. Jupyter notebooks, ever since I discovered them I felt that they were frustrating because it's not saved in a flat text format. You couldn't just go in there and edit the flat text file, you had to edit it in an editor that allowed you to work with those specific files. That for me was always very frustrating just to have this whole ecosystem about reporting in Markdown really well integrated and also with Python inside there is really nice system. And I think another part that kind of goes back again to the whole ethos in R is the community. And many people I realize don't appreciate this. If you've never really been in the R community, people talk about it a lot. But it's something that you see at our conferences. At the user conference. The, the R conference just took place. The, the International ARC conference just took place a couple weeks ago. There was a woman from Ghana and she was speaking about diversity and inclusion and there was a whole panel discussion about diversity and inclusion which first off is pretty impressive in a program language tech conference that there's a whole panel discussion only about diversity and inclusion and accessibility in. In that language which, which was massively impressive. And we have people with vision impairment and talking about different racial aspects to, to accessibility and things like this. So it was really interesting discussion was very impressive that that was in the use our conference and this woman from, from Accra, unfortunately I can't remember her name, she that she's been in the business for decades and there is no community like R that is as diverse and as inclusive and as concerned about accessibility as the user community is. And it really stands out and unless you really experience that, you don't really know where that is. Right. I started programming in high school with basic Programming languages that you learn at that stage. And then for my work, I started to learn Perl. And then we look at Python and you look at the way people communicate and the way people interact with each other, and user community is really quite different. I think that's really a massive strength. Another, another huge strength is data visualization. So Python is kind of catching up to this. But data visualization in Python was for a long time very frustrating, and ggplot2 really kind of came and dominated R, and it has a very, very good foundation. Right. So Paul Murrell just gave a really interesting talk at the user conference about the Grid package and different tools and developments that happen inside there. So data visualization as a core functionality has been there since the beginning and is very well supported by the core team at R&D. Plot two is just a wonderful package, which massive amount of extensions at this point, which make it incredibly flexible. And of course, I have my courses on datacamp on G Plot too, so plug for. For me and datacamp, you can check out my courses there or you can join one of my online courses if you're a student in Germany. And then the last thing maybe I would mention is Shiny that goes part and parcel with markdown in terms of an easy reporting method. Just the interactive markdown documents. Having a shiny runtime is already using shiny to a brilliant effect in a very, very simple way. You can have interactive documents in a really nice, easy, simple way which competes with anything that Python has. And then you can build upon that using the same syntax and have really nice, elegant web apps which are getting more and more supported to be really being professional data products in their own right.
Yeah, I'm also a big fan of R. Right. I mean, obviously I'll cover some things about Python because we want to make the comparison right. And I really have to say about the data visualization part, for somebody who comes a bit from the Python world, for me, the ggplot package is, I would say it's more than a package. I mean, such an interesting way to do data visualization. It really goes beyond the syntax. And I do think for a Python user to see how a ggplot is constructed, like how do you layer a plot in the crazy amount of flexibility and how you can change different models, use extensions about it. I think it's extremely important. This goes to the point which I made about a different way of thinking, so I can really suggest that.
One, yeah, definitely agree with you here on Shiny and ggplot. Two, I think even though primarily I'm a Python user, I think ggplot2 offers a very interesting framework for how to think about visualization and I think Shiny is so far R's biggest killer app for sure. Similarly, Boyan, given that Rick described the top five features of R for pythonistas, how would you describe the top five features or components of the Python universe to users with a capital R?
I think exactly like thinking about Python, the origins of it and where it is right now. I think for an R user it would be amazing to see how much stuff is out there and obviously that comes with, I mean it's not only a positive thing, it can be a bit overwhelming to see what kind of things packages are available for Python. But the ones which are mostly used, I would say like 80% of data science work. These are the PI data stack. So this is your Numpy Pandas scikit Learn and I make a big argument in the book why this is such a great thing, how well they integrate with each other because you can use them really interchangeably. Like for example, Pandas data frame underneath is like a collection of numpy arrays and scikit Learn just works with it. And this is something which I always found amazing that you can expect things to work in the Python packages together. And this is something that I think our users definitely should check out other packages and tools and frameworks for our users which might be interesting. They are from kind of adjacent to data science fields. I mean, I'm a big fan of the idea that the data scientist should be quite comfortable with data engineering as the workflow. I mean obviously data scientists don't need to know Scala for example, or do complete pipelines, perhaps only by themselves, but they should know some of those things, how they're done. I would personally expect people to know how to build an API and for those type of things. Python, because of its kind of glue like nature, they have developed so many more packages. Like over the top of my head, just Flask, perhaps bentoml, fastapi. These are just wonderful, wonderful tools for you to deploy your models. And I think also Python makes it so easy to go and do different things. For example, as an R user you might think, how do I get into iot? How do I get into, you know, there's a weird database that I need to explore and maybe Python has a package for that and this is kind of the big benefit there.
Obviously the package ecosystem is a crucial consideration practitioners make when deciding for one language over another. Can you walk us through which sub domains of data science you Think each language excels in and what are the criteria you choose when evaluating one particular ecosystem over another.
So me and Rick had a discussion about it before we started writing and it wasn't immediately obvious to us how to make the distinction. Our first idea was to focus on the domains of application, for example finance, bioinformatics and things like this. But that clearly didn't feel right to us. In a way it felt a bit like too discriminating against other domains and didn't feel the right way to split the two languages because in some of those domains there is a mix. I mean clearly you might make the argument that in finance there is a lot of R stuff there, but this is changing as well and the balance might be switching in the future. And our decision there was to split the two languages the comparison into two levels. So one that we selected is a data format and by that we mean the way the data is stored. So in a way you could say, okay, we have spatial data, we have image data, we have text data and we have time series. Obviously as we write in the book, there are some others, but this you can see, okay, they correspond to big proportion of what we see in the real world. And how does R and Python connect to those data formats, how easy it is to work with them. The second level that we chose was the level of workflow. I mentioned data engineering before Rick mentioned data visualization. So in the book you write for example about the machine learning workflow, the exploratory data analysis workflow, the reporting workflow, and we want to make the comparison which one of those is easier to do in one language or the other. So maybe I can give a specific example for the EDA workflow what Rick mentioned and I also supported him in that ggplot is such an amazing tool to do data visualization and it's so, so nice to plot things in our. It's so easy to make really amazing reports as well. And for both of us it was very clear that our recommendation with to do that while for example if you're working with a text data format it might be stories more in a non relational database and as I mentioned before, the glue like nature of Python makes it much easier to find a weird database connector for that and work with it. And like tools like Spacy for example more of the natural language processing tools, they are just extremely mature in Python and this is how we made the distinction.
Yeah, maybe I would also mention here that in terms of thinking about the workflow and the data formats of when you would want to use each language. So really on a use case based scenario and not on, okay, this domain in this field and this industry, you're going to use this language, but really to think about, okay, what is the kind of data, what is the problem, what is the workflow? And to focus more on that means that we kind of frame the language usage in more of a generic term, right? So the way I always like to think about, whether it's data science or being in the laboratory as an actual scientist or, or a programmer or whatever you've got, is you've got this bag of tricks. And you know, the, the younger you are, the more novice you are, you've got this like small bag of little tricks, right? So also in math, right, like high school students have got a very small bag of tricks. And the more you get deeper into mathematics, you learn really about different tools and your bag of tricks grows. So when you see something you have more tools that you can use with, your bag of tricks grows. And part of that, that bag of tricks is just expanding your language use here and identifying generic scenarios that you can use either one of them, right? So I think that's more of a way that we kind of try to approach the use cases for when you want to use one language versus versus another. And then some of that goes right back to the early days, to the very ethos, right? So like the EDA and the data visualization. So stuff that BO mentioned that is, I see that as really being hard baked right into the foundation of R. And something that I mentioned also in the book is that when you look back at the origins in the late 70s and early 80s of s that eventually became R, you saw that the people working on it were very much embedded in the statistics community at the time and they were publishing books about exploratory data analysis. Right? So Tukey, I think was the one that coined the term exploratory data analysis with his book called Exploratory Data Analysis. And he was not involved in authoring S at that time, but he was partner parcel with the whole cohort at Bell Laboratory. So, so the originator of exploratory data analysis was in cahoots with the people that were working on S at that time and, and also thinking about using data visualization as a tool in exploratory data analysis and as a tool in explaining and reporting. That was, that was present all the way right back at the very beginning. So that kind of ethos really led the way and made that. And of course you can do really good visualization and EDA in Python. That's not, that's not the issue, but it's just that that really defined a lot of. I think what came later in R.
I think that was one of the most interesting parts of the book, especially how it connects the strength of each language to its history, especially for someone early in their data careers like myself. You point out in the book as well that there's a lot of room for interoperability. Interoperability between both languages. So practitioners may not be as locked in to one ecosystem as they might think they are. Do you mind walking us through how interoperability works between both languages?
Yeah, I mean it's a bit of a growing field and while writing the book we realize, okay, this is still early days in doing such work. Maybe I can talk a bit about the idea how, why you do such a thing. What are the possible scenarios when you might selected different technology. Maybe Ricky can go through the specific example in the book because we have a super nice case study at the end of the book which we built and I think when you try to. Why would you want to work in the same environment? I think that's an important question to start with and then we can get into the how. I think the why comes from again the modern teams. I think they start to become bilingual. You see it in job boards and job descriptions. You start to see that companies, they cannot afford nowadays to say, yeah, we are looking for our person with whatever shiny experience they realize they need to hire people who can solve problems. And this makes the community much more diverse in the company as well. And then you start to run into those issues that we also talk about, like what do you do when, for example, you have a machine learning person who is working on a machine learning workflow and this person comes from a computer science background with high performance computing. And this person is very proficient in Python. No SciKit, learn, TensorFlow, PyTorch and all of those things. And then in the same team you have somebody who comes from, let's say a more standard statistical background where, let's say in psychology, for example, where they use a lot of R to do statistical testing and visualizations, perhaps, and you put those people together. What might happen is, I mean one way to split it from a project manager perspective is you have the person doing the EDA and then they kind of communicate to the machine learning person, the machine learning engineer who will build a model in Python. And that can become a challenge because how very often you do need to run, at least run each other's code, you need to also understand how certain things happen. Right. And even to take the example further, when you're done with the model, even if you did it in R, how do you deploy it? You go to the data engineering team and you say, okay, here's my model in R. Go have fun. And you see that this becomes a challenge. And we did a survey on a few tools which help you with this workflow and how to combine them together. And our selection of choice was Reticulate, the package that we use in the book. And I think from our perspective, it gives you the great combination between both of them.
I can elaborate on that a bit. Before we get into Reticulate, I want to go back to a point that boy mentioned at the beginning, which was really using and being bilingual in a company in a practical context. And one point there that I kind of want to highlight is that there's many ways of doing data science, and data science is not a protected title, and it's not a certified title. It's not a career that has letters after its name that says, oh, you are a certified data science. And this is exactly what it means. Right? So. So data science means a lot of different things. And on the ground, it. It looks very different depending on the context in which you see it. It looks different in academia versus in industry, and it looks different in smaller companies versus larger companies in the way it's integrated and where it's using the expectations and the tools that we use.
Right?
So when we think about data science being deploying models in industry, that's one aspect, Right? And working with the data engineers, that's one aspect. But there's many different ways that we use that. And so what I'm seeing, I'm not involved in hiring, thank God, but I am in contact with people that are. That are hiring. And one thing that you see come up over and over is that people are less concerned about the language and more interested in your skills as an analyst and really understanding analytical thinking as distinct from critical thinking skills. So really understanding what those things are and really being able to demonstrate that you have analytical and critical thinking skills, because those things are very difficult to learn and they're very difficult to teach. Right. So I try to have that in my courses, but it's really difficult to kind of really make sure that people kind of get that across and really difficult to teach that. So if you come to a company having been able to demonstrate that you have critical thinking and thinking skills, you can pick up one of the languages and if you only know R, you can pick up Python. I know people here in Berlin that have very, very strong math background, and it's purely R. And they're hired at a startup, a very small startup, and they're given a month and the first month is learn Python. Your job, your job is literally learn Python. And we're going to give you one month, we'll pay you as salary, and your job is to learn Python because we want you and your skills and your math skills and your analytical skills, and the language is relevant. We use Python, so we'll give you time to learn it, right? So in that sense, it's really good to be able to kind of switch back and forth, but it's more about how you think and do you really understand the problems that are available and also really understanding the business use case scenario and how your work is related to the needs of the company and the bottom line and the return on investment. So those are really important skills that are really language agnostic, right? So then you come into a company and maybe you're given the freedom of which language to use, but you may be working with people that are using a different language, that may not be allowed. You may be encouraged to use one language just because it makes things easier, but if you are able to, you may be able to use R. And then somebody has some Python scripts. And that's a scenario that I've seen quite often. You come into a laboratory or a company and somebody has made a workflow or some protocol written in Python with maybe no documentation or I've also seen incredibly detailed and complicated documentation because the scripts are so complicated and messy that you need this massive amount of documentation so that people can just make heads or tails of it. And so instead of trying to rewrite all of that Python in R, just use it. And this is something that's been going on for decades, since the early days of computing, where you just pass documents and you just call one script from another, right? So you can see that Bash is calling Python scripts and you're calling Python scripts from R. And those are things that have been happening for decades and for a long time before the days of Python. So just calling scripts between and passing documents between one language, that's already interoperability, right? So using those skills and then just using the scripts that you have available to you. And then of course, as Boy mentioned, the next level is really being bilingual, then using them together in an integrated environment. And that's the, at the Moment, the best supported way of doing that is with Reticulate, but that's really a specific use case where you really need to be passing objects between the different languages and not just calling a script from one language to the other.
So in the final chapter of the book, you brilliantly laid down a case study showcasing how R and Python can work together in the real world. Before you describe this workflow, what are the real world scenarios where data teams need to use both languages in the same workflow?
I think it goes back again to this concept of just using existing resources. You don't need to reinvent the wheel. If somebody in the company already has a solution that works very well and you just need to pass a specific data set data format to that script, then why not, why not just use it and you can, you can reuse existing resources in an easy way. I think maybe Boeing, you can speak to some specific scenarios or specific examples.
I mean, one thing which happens is what I mentioned before is in Python you have a ton of packages for everything possible, right? And often, often as the data scientist, you want to figure some specific problem and you have the feeling somebody else has solved it almost always. And then let's say you're an R user and then you see, I know in Python you have this super nice package, does this very specific thing. Let's take the NLP example, let's take a nice package like Spacy and you might think, yeah, okay, Spacy is such a cool package, I would love to use it, but maybe I need to know Python to do that. And you can use for example, Reticulate from within your RStudio. So that's the nice thing about Reticulate that is also pushed by RStudio is that it's very well integrated in the IDE. So, for example, if you are importing objects, Python objects, you will see them in the environment pane. So, for example, a Pandas data frame will be available there together with your R data frame and you can run both Python R code on it and you can show your plots. So the tools make it very easy to do such stuff. And you might take this weird package from the other language and use it. You can just run it from within your tool and take advantage of it without using a wrapper. Because a lot of those tools nowadays which are ported from one language to the other one, case in point, maybe Lime for explainable AI, there is also, I think Keras is also a wrapper. So there's a few of those which, for example, just call the functions under the hood from the other language. I mean, this is all fine, it allows you to do things, but you have to rely on the developers maintaining those packages and keeping them up to date. While if you use reticulate from RStudio, if you really work how we showcase in the use case, then you will take advantage of the most recent version of the package without worrying and you can have a Python code which somebody can look through as well.
So given how data science languages are becoming more and more interoperable, what is your advice to someone who's starting off in the data science space? Right, right now? Which language do you think they should learn first? How do they maneuver through becoming bilingual?
I mean, there's a different choice that was like the choice, you know, do you learn, do you learn the specific language or do you learn by learning by doing is what you hear all the time. So this is a question which both of us, I think have received so many times. You know, do you pick R or Python at the beginning? Right. And you could make the really nice argument for R in some cases saying, okay, super easy to set up R. You just downloaded RStudio is an amazing, amazing IDE. Now we have VS code for Python as well. So that's getting better. But Python setting this up, you know, do you use Anaconda? Do you use virtual environments? Do I have a system Python? It's not so easy, right? But if you ignore this argument, which is a fair one, I would say that you should not even think about the language. You should think about what you're trying to do. Even as a beginner, our advice I think would be focus on the problem that you want to solve. Let's say you want to learn data science. Our advice would be pick a problem that you find interesting. Many people say I'm interested in investing, perhaps, and in that case, sure, some of the data sets are more like time series related. And then we go into what we discuss in the book Take for time series data. You know, you have super nice packages in R, how to visualize it, for example, and then you go into R and then learn it by doing so. This would be my advice, do not worry too much about which language because they will be converging in some aspects, in some aspects not. You should know both. Ideally in the long term.
I would agree with that, that it doesn't really matter at the beginning, but I would also add to that that. But I kind of have a different perspective on how you should go about learning data science and why you should be Learning data science. And a lot of people are motivated by career and by money, and that's fine, right? That's perfectly legit. And maybe I'm a little bit of a naive academic, but I think that it's more of if you want to enter that field and if you want to learn data science and you're thinking about what's the best way to enter into the field, it really needs to come from a place, motivation that is an authentic curiosity. I think that's something that's hard to fake. And if you, if you don't have that authentic curiosity in the problems and really just, just a pure fascination for how and why things work the way that they do, and really picking apart things and understanding how they work, it's kind of hard to fake that. And it's kind of hard to develop your analytical and your critical thinking skills to do that. So you may have the actual tool set, but if you don't have that feeling for it. So, you know, people say you have to love data. You know, I don't know, you don't have to love data. Sometimes I really hate it, and it really completely drives me nuts, depending on what kind of data set I get to work on or what I'm looking at. But I really love seeing how things work and picking things apart. And so think about, you know, your passions and how those come into play in data science. Right. So in that case, the language is less important. It's really more about kind of what your motivations are for learning data science and entering into, into, into the field. And then in terms of what language to use, I would say based on your interests and things that have brought you into the field that are guiding your passions, choose the language that your colleagues are using. Right. So I, I teach mostly young scientists and I, I love the problem that I'm faced with because it's kind of opposite to what most young new data scientists face. The problem that my students face is that they have a lot of data, and it's really fantastic and very interesting and idiosyncratic, unique and very expensive data that they've collected themselves through experimentation in the laboratory. And we're talking about everything from immunological data, data on primate behavior, climate data, stuff in oceanography, all kinds of different interesting data sets that my students are working on, and they need help on how to work with this data. So they're very desperate and they're hungry and they're very eager to understand how to use it. So they just want to know, I need to answer this problem and I want a tool that's going to allow me to do that. And they want to work in ecosystem where they have that support. And for many of them it's going to be R. Right. So they have that kind of issue where that's what's guiding their decision. A lot of people that come into the field, they don't have a problem that they need to solve, they just are learning for the sake of learning. Which is fine, right? Completely legit. But then they face that issue where they've got a lot of skills but they don't have any data to actually work on. So they're just skilled people looking for a problem to solve. And it's kind of the opposite. And I think it's nice if you have a problem that you need to develop the skills to answer that and it's much more motivating and in tune with what you're looking for. And then you choose a language that you have the most support in which your colleagues are using that helps you answer your problem as easily as possible, basically.
So if you want to flip the switch maybe a bit and provide guidance for maybe experienced data scientists looking to pick up the language that they're not used to working with, what's your advice for their learning journey?
Well, there's a really fantastic book that was just published that's really fantastic. So, but one thing that I recommend to, to my students when they're just starting out is take something that you know, the answer to that you know, work and try and reproduce it in the other language. And, and this is not what I would encourage on a daily basis. This as a workflow. Right. Because it's basically like a one to one translation. So one to one translation works in terms of really kind of trying to help you understand and really seeing that you got the so called right answer. It's not something that you want to do every day as part of your job. Right? Nobody's going to employ you to be the one to one translator, but in terms of learning it's really nice. So for example, I tell students that are really just starting out that take something that you've done in Excel and SPSS and Graph Pad, Prism and whatever genome viewer you're using, blah blah, blah, and try and reproduce that then in R and then, and then see the workflow and don't worry if it's a big hot mess. Just the main priority is that you got the right answer, that you got the answer to the question that you thought you were asking and not that you got the right answer to the wrong question, which is the worst thing ever in data science, 100%. The worst thing worse than not knowing what you're doing is getting the right answer to the wrong question. So that's what I tell my new students. And I would say for the intermediate that already are very good in R Python is to do the same thing, take your Python and try and reproduce it in R and see how you can build upon that and see how you can make it a bit more elegant or vice versa, and see where the advantage is and you can kind of tease apart the ways inside of there.
Yeah, maybe about the more experienced data scientists, how do they get into the other language? I can say at that level, I think they would have the stamina to go the hard way. I mean, actually, why didn't I studied biology, right, Biochemistry. And why that happened? I was still interested in code. The problem was my father bought me a big book, more like a reference book on Visual Basic. And I gave up because of this. Obviously you get this huge reference book on really like nitty gritty of the language, you know, and that, yeah, that wasn't a great idea back then. But actually I do think if you are super experienced in either tool, you might actually go that way. You really can look at the really practical differences, the one to one differences. You might look list comprehension in Python. That's super interesting. How Pandas is also structured, how the Pandas syntax is different from dplyr, for example. You might really go the hardcore route where you really look in the theory, not that much on the data and the practice.
Sorry, like on that point with Visual Basic, actually that was one of those languages that I learned in high school and, and I learned it and the motivation for learning it was because we were basically, it was, I think like an upper level computer science class in high school. And we were given the task to make a program. And the program my team decided to make was bubble. Bubble or not, not bubble, bubble, but you know, these bubble bursts, you know, you like, you point the thing and there's all these bubbles at the top and then you match three res and then the burst. And so we made that game in Visual Basic, right? And that was, that was highly motivating to work as a team to do that because we saw the output at the end, right? And so that kind of comes back to this point of you have a problem that you want to solve. Our problem was we need to get credit for that class, for that class. And so we need to do this project, but that that's the difference in learning, of having a clear goal that you want to achieve and a reason why you want to achieve that goal. Right. I need to answer this problem with this data for my research and nobody else in the world is addressing this. So I'm very motivated to be the first person to address this. That was one of the motivations when I was a PhD student, I wanted to look at gene order between different species. And at that time it was really just coming on board that you could look at synteny and homologous genes between organisms. The idea was to find where you lacked synteny and where you had orphan genes. And there's no program that's going to show you orphan genes in different organisms or where you lack synteny between homologous genes. And so I pitched this to my supervisor and I was really lucky because my supervisor was completely hands off in a classic German style. I absolutely loved it. And he said, okay, well, I guess you're gonna need to learn how to program. And I was like, yeah, I guess so. So I got a book on Perl, and there was an expert in the lab who actually had written a book about Perl. And I got his book and I started just going through it and learning Perl. And then I realized that the problem wasn't as interesting as I thought it was. But that was a motivating factor of me to learn Perl. And that was an entry into R and then later into Python.
That's really great. And I really admire this means and ends approach to learning programming languages. So before we wrap up, I'd love to get your thoughts on the future of programming and data science and where you think it's headed. What do you think are some of the major trends that will affect programming in data science as we know it today?
From my experience, the future is bright. I would say I don't think there's ever been a bad your time to be a data scientist. Both of those languages are extremely active. There's amazing things happening every week. The tools are so nice, your ideas are nice. There's so much material online where you can learn, there's so many problems to solve. So I do think the future is very bright to be a data scientist. One thing I can argue now is you could see this trend of tools become better, which makes which democratizes data science. It's much, much easier to do things, which comes with some dangers, right? Because if it's easy to do machine learning, you might do bad Machine learning, more people statistically have a chance to not such great ethical work, for example. So we have to pay attention to that for sure. But more importantly, the question which sometimes I get asked is, yeah, as a data scientist, do you think in the future you get the job automated? You know, like, yeah, we'll run out of work because, you know, we have GitHub, Copilot and stuff like this. I would argue perhaps, perhaps it's possible. In my career so far, I haven't just seen the field grow, but I would definitely argue for new roles to come up. For example, like mine, which is a data strategist, where skills like communication, empathy together to the team, how do you think about business? For example, how do you think about the domain? This general mode, problem solving and software skills will be much more important in the future, perhaps through the most jobs, I would say. So it's super important for data scientists to learn those things as well.
I would agree with those. But I think there are some other clear trends that I think are going to dominate in the future. One is, I mean, there seems to be a trend away from being really strong Python and R programmers. And so one of the trends that we see is, as Bojan mentioned, things like AutoML or the Copilot that was just released by GitHub. And although those. And I think AutoML is still kind of developing, even though it's been around for a while, it still is not really running completely independent. People are still having to intervene manually and take a look at the results there. And Copilot is basically still in its early phases and people have already reported on a lot of problems and reasons why we should not get so excited about it. But the trends are there, right? And whether those things really flourish into really being standard bearers of how we do data science is yet to be decided, but they could very well potentially be there. And that means that we're getting less and less actual input from programmers and it's less important that you're really a good Python or R programmer. One other trend for that is the actual, actually the tidyverse in R. One of the reasons why the tidyverse exists is there's several reasons, but one of them is to just make the learning curve easier for new entrants into the field. So to just get stuff done. And so there's a school of thought that is just teach the tidy verse, just do the tidy verse, and everything's in the tidy verse. And part of that is that you want to just show how to analyze a problem and Then that's the end of story and then you're done with it. And these are not people that are going to be career data scientists and they don't care about how it works under the hood. They don't care about attributes and they don't care about the details of a list and metadata and vectors and how things are put together in R. They just want to get their stuff done. And I can see that. But what that means at the same time is that you're having people that are just using a set of commands, which are umbrella commands or convenience wrappers that are not really getting really deep into understanding how those things work. So there are trends which are kind of moving away from a very detailed, fine understanding of Python and R. And if that continues, then it means Python and R are actually less important. Right. And aside from that, not only do you have this automation, at least convenience wrapper packages and tools, but you also have other packages or in other languages that are coming up like Julia. Right. So the Julia conference I think just wrapped up yesterday. They had fantastic learning tutorials the whole week. Really fantastic things on all variety of different topics, including a lot of things related to inferential statistics, Bayesian statistics, machine learning, really like hardcore data science topics, I think even some stuff in the life sciences. So really interesting stuff happened with Julia and who's the same? Maybe Julia has been increasing for the past years and maybe it will continue to increase any overtake Python and R. So I think one of the key take home messages in the community in looking at the field is that you have to kind of keep on your toes about keeping your skills up to date and really thinking about, okay, what's the thing I need to learn to really keep on board to make myself relevant for the company or the position that I'm really adding value to that. And it comes back, I think, to things like critical thinking skills, analytical thinking skills, understanding the business problem. And something that Boyne mentioned as well was the communications and the empathy and speaking on that regard. I think those things get talked about a lot in recent years, but I feel like they're oftentimes just paid lip service too. And there's very little really understanding, like what does that mean, right? Like what is actually communication skills and how did that really stay on the ground? So for me that is in the larger context really focus on the idea of data design, right? So what is the design of a data product? And that's really from, from start to finish and part of that is really understanding the use case Understanding the user as a core feature in designing data science solutions, Data science products. Right. And then when you think about design, then you start really thinking about the user. You start thinking about people and the design community in all various aspects. They're much more deeply embedded into really understanding developing a product for a user and understanding the Persona and the people that are going to use it. I think that's something that is not discussed enough in data science. So I think the empathy and the communications will increase and I would also predict that there's going to be a bit more of a focus on the actual design. So there was just, I think in the last year from Berkeley, the Institute for Data Science in Berkeley was, was able to get funding for a data science by design group with, within that and they just had this data Science by Design creator conference. And that I find really, really fascinating, really exciting. But here we see this focus on design, but there's also this focus on the creativity aspects of that, which is wonderful, which is a really nice aspect. But art and creativity is part of design. But you can be a designer without making art, without making visually stimulating creative objects. And so design is really something that runs through a lot of what we're doing. And I think it's something that data scientists have neglected to think about and I think it's something that will increase in popularity coming up.
That's all super fascinating. It's great to see a world where data science is becoming increasingly democratized. Finally. Rick Bojan, do you have any final call to action before we wrap up today's episode?
From my side, I'll just repeat what I said about. It's just never been a better time to be a data scientist. I think it's important to be also a good data scientist to work on problems which are important to the people around you and to the world. And there's so many problems to solve. I think both of us have such rewarding career so far. I don't think we regret anything about our field. So I would just invite more people.
I regret everything.
It.
I don't agree with that.
I just invite more people to.
If you didn't make choices that you regret, you're not, you're not making the right choices.
Okay.
So you should be regretting some parts.
Of the things for sure. Please join us on this journey. Become a data scientist. Move, move into the field and solve the problems that we have. Yeah.
So one, one thing that maybe I would like, like to mention before we wrap up is that we do have a website for the book. So first off, get the book. It's really fantastic. But we do have a website for the book that come coming back to the idea of design and I really do see being bilingual as part of understanding the design of data science products and really understanding your skills as a designer, not just a data scientist. And the website is called moderndata.designnot.com. design because we're fancy. So Modern Data design is a website and there you can sign up to get updates on the book. And we are preparing a nice little cheat sheet which is the R Python Bilingual Dictionary cheat sheet which you can sign up to receive by entering your email address into the website and keep up to date with any updates on the book.
We'll definitely include all these details in the show notes and whoever visits the site, it's really beautifully designed with that. Thanks a ton Rick and Bojan for coming on the show.
Thank you.
Yeah, thanks a lot, Adele. It was really nice talking to you.
That's it for today's episode of Data Framed. Thanks for being with us. I really enjoyed Rick and Bojan's perspective on creating a more inclusive data science learning journey that incorporates both R and Python and promotes a needs based approach to learning. If you enjoyed this podcast, make sure to leave a review on itunes. Our next episode will be with Noah Gift on creating pragmatic AI solutions. I hope it will be useful for you and we hope to catch you next time on Data Framed.
More from Richie
#359 My Best Friend is AI with Valerie Tiberius, Professor of Philosophy at University of Minnesota
#358 How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon
#356 The Forecast for Time Series Forecasts with Rami Krispin, Senior Manager of Data Science at Apple
#355 AI's Impact on Databases with Shireesh Thota, CVP of Databases at Microsoft
#354 Beyond BI: Decision Intelligence with Graphs with Jamie Hutton, CTO at Quantexa
#352 AI Agents at Work: What Actually Breaks (and How to Fix It) with Danielle Crop, EVP Digital Strategy & Alliances at WNS
#351 Will World Models Bring us AGI? with Eric Xing, President & Professor at MBZUAI
#350 How to Make Hard Choices in AI with Atay Kozlovski, Researcher at the University of Zurich
#349 From AI Governance to AI Enablement with Stijn Christiaens, CEO at Collibra