Hướng dẫn should i learn r and python both? - tôi có nên học cả r và python không?

Learn Data Science, not Programming

With the outbreak of the Data Science revolution a “war” between R enthusiasts and Python fanatics emerged. As a result Python and R have been compared and contrasted a thousand times with detailed listings of their respective advantages and weaknesses (e.g. see our infographic for a refresher).

All this “warfare” led to the misconception that as a data science learner & enthusiast you should relentlessly focus on mastering either R or Python. This is bad advice. Namely, the actual key to become a data science professional is in understanding the underlying data science concepts and work towards expanding your programming toolbox as much as you can. In other words you should aim to learn the fundamentals of both R (see Introduction to R) and Python (see Introduction to Python for Data Science), one after the other.

So while it is certainly true that it is important to know the differences between R and Python, today it is more relevant to understand how you can leverage the knowledge of both based on your understanding of fundamental data science concepts. In this post we hope to explain to you why you should learn both, and give you some ideas about how to begin.

R vs Python, different brushes

Why are you choosing between R and Python in the first place?

Most likely you are in need of a tool that will allow you to perform data analysis, do statistical computations, and in general be a data science practitioner. So knowing R or Python is just one component of a bigger whole, which is comprised of knowledge from disciplines such as statistics, computer science, engineering, mathematics, and even graphics design. There is a reason why most data science curricular begin with a computing tool, but never end with them.

Hướng dẫn should i learn r and python both? - tôi có nên học cả r và python không?

You should think of R and Python as two different brushes that will allow you to better express yourself in data science projects, and take advantage of their individual unique features. Surely the brushes have different grip and texture, but they are also very similar and will allow you to do so much more.

Do not choose between R & Python, learn both

In general, you shouldn’t be choosing between R and Python, but instead should be working towards having both in your toolbox. Investing your time into acquiring working knowledge of the two languages is worthwhile and practical for multiple reasons.

It strengthens your data science communication skills

Both R and Python have strong online communities such as R-bloggers and python.org dedicated to the respective languages. Looking at these sites you can get the impression that R and Python communities are completely disjoint. Unnecessary to state that is not the case.

In the real world of data science, Python and R users intersect a lot. So whichever industry or discipline you are interested in you are likely to run into projects done in both languages. To appreciate it all you need to have at least a basic understanding of both R and Python. Furthermore, by mastering both, you have the advantage and versatility of presenting and communicating effectively regardless of whether your audience is more comfortable with R or Python. So if you strive to become a data scientist, you will eventually need to be fairly familiar with both languages, and most likely a whole lot more.

It boosts your data science career

Knowing both R and Python will open doors for more job opportunities. Some companies, or departments within companies might prefer Python, while other like to work with R. Imagine that you are a perfect fit for the job, except that you know R while the company requires you to know Python. Wouldn’t that suck? Generally professionals from the industry encourage entrants to acquire as many tools and skills as they can. Most of the time you won’t be expected to be a complete master of R or Python, but displaying your commitment and passion by having learned at least some of both will only give you bonus points.

It is not that hard

You can think of Python and R as Spanish and Italian; they are both very different and very similar at the same time. They have a different syntax and have their own (technical) advantages, but at the same time they become very similar when appropriate Python packages are used (numpy, pandas, …). For example:

Suppose you want to load csv files. In R you have a couple of options, one of which is read_csv(…). In Python you can use a function from the Pandas library with the code pd.read_csv(…). Spot the difference!

Also, both Python and R are what is considered «scripting languages» which allows you to write snippets of executable code without having to use a compiler like when using Java for example. Next, they both have libraries and packages that you load into your environment to add functionality and do the tasks you need to complete. In addition, when working with both you will experience that your workflow for both languages is very similar, as are the documentations and communities surrounding them.

Nơi thế giới r và python vượt qua

Trước đây, người ta có thể lập luận rằng mặc dù R và Python là hai công cụ rất hữu ích mà bạn có thể học được, nhưng điều đó không đúng là người ta có thể vẽ trên cùng một bức tranh với chúng. Ngày nay, nhờ các công cụ và công nghệ mới, lập luận đó ngày càng trở nên không hợp lệ.

Chúng ta ngày càng thấy rằng các vũ trụ R và Python đang bắt đầu chồng chéo, do đó giảm thiểu sự cần thiết phải lựa chọn giữa hai ngôn ngữ. Hãy xem xét một số ví dụ về các công nghệ và công cụ cho phép tận dụng kiến ​​thức của cả hai ngôn ngữ và do đó giao với các biên giới giữa thế giới R và Python.

Notebook Jupyter

Hãy bắt đầu với dự án Jupyter. Notebook Jupyter về cơ bản là một công cụ cho phép bạn viết và chia sẻ mã thực thi bằng nhiều ngôn ngữ lập trình. Tên «ju-pyt-er» có nguồn gốc từ Julia, Python và R ngay lập tức cho bạn biết rằng ba ngôn ngữ này là trọng tâm, mặc dù ngày nay, những cuốn sổ tay trực tuyến này hỗ trợ một cái gì đó giống như 40 ngôn ngữ khác nhau.

Khi làm việc trong một dự án trong Jupyter, bạn có thể ghi lại cả Python và R theo cùng một định dạng và chia sẻ các máy tính xách tay này với đồng nghiệp, khách hàng, sinh viên hoặc bất cứ ai. Jupyter không phải là IDE và không cố gắng thay thế Rstudio hoặc Rodeo cho Python. Những gì Jupyter làm là nó cung cấp cho bạn một không gian phổ quát, nơi bạn có thể hiển thị công việc của mình bằng ngôn ngữ và do đó tổ chức công việc của bạn hiệu quả hơn khi thực hiện cả R và Python cho một dự án.

Nếu bạn quan tâm đến cách sử dụng Jupyter với r, hãy đọc các bài đăng này từ Continuum Analytics & NBSP; và Revolution Analytics để bắt đầu hoặc xem một ví dụ về những gì bạn có thể làm với chúng. Ngoài ra còn có một hướng dẫn đẹp từ Quant-econ.net mà bạn có thể thấy hữu ích.

Tôi có nên biết cả R và Python cho khoa học dữ liệu không?

Trong thế giới thực của khoa học dữ liệu, người dùng Python và R giao với rất nhiều.Vì vậy, bất cứ ngành công nghiệp hoặc kỷ luật nào bạn quan tâm đến bạn có thể sẽ gặp các dự án được thực hiện bằng cả hai ngôn ngữ.Để đánh giá cao tất cả những gì bạn cần để có ít nhất một sự hiểu biết cơ bản về cả R và Python.To appreciate it all you need to have at least a basic understanding of both R and Python.

Bạn có thể sử dụng R và Python cùng nhau không?

Sử dụng R và Python cùng một lúc là cực kỳ dễ dàng nếu bạn đã chuẩn bị các tập lệnh R của mình.Gọi họ từ Python sôi sục xuống một dòng mã duy nhất.. Calling them from Python boils down to a single line of code.