15 Python vs R
15.1 Comparing Python and R
Now that you have learned both you will be able to “speak” the same language as the team with which you’ll be working. This makes it easier to share code and collaborate on projects.
15.2 Recall: What does “high-level” mean?
A high-level programming language features a syntax that is easy for humans to read and understand. Low-level languages are those that can be easily understood by a machine. Examples of high-level languages include Python, C++, C#, and Java.
When you write code in a high-level language, it gets converted into a low-level language, or machine code, that your computer can recognize and run.
15.3 Strengths and weakneses
While both Python and R can accomplish many of the same data tasks, they each have their own unique strengths. If you know you’ll be spending lots of time on certain data tasks, you might want to prioritize the language that excels at those tasks.
15.4 Python is better for…
- Handling massive amounts of data
- Building deep learning models
- Performing non-statistical tasks, like web scraping, saving to databases, and running workflows
15.5 R is better for…
- Creating graphics and data visualizations
- Building statistical models
- Its robust ecosystem of statistical packages
15.6 Summary
- Python and R are both excellent languages for data.
- Keep using Python and R to improve your programming skills
- Take a more advance course and earn a certificate: Google Data Analytics Professional Certificate (R) or IBM Data Analyst Professional Certificate (Python)
15.7 Reflection questions
Why is it helpful to be familiar with both Python and R when working on a data science team?
How could you apply both R and Python in a single data project?
How could your ability to “speak” both languages improve collaboration on a project?
15.8 Exercises
What is meant by a “high-level programming language”? Give an example of how this applies to R.
What does the word “syntax” mean when talking about programming? Give an example in R.
What is one major strength of Python as a programming language?
What is one major weakness of Python compared to R when doing statistics?
Provide one major strength of R compared to Python.
Provide one major weakness of R compared to Python.
Give one real-world example of when Python would be the better choice and one example of when R would be the better choice.