Python is an open source programing language commonly used in data science as is R, which
one should you be using at this point?
You might be expecting a fence sitting.
Well, it depends kind of answer, but no.
I'm going to tell you exactly which one to pick right now.
So here goes.
I ask you a question, and based on your answer, you'll know which language to go for.
Ready?
Okay.
So do you have much in the way of programing experience?
None, use R, some go for python, lots, R again, I'll explain.
Okay.
Question to do you care about awesome looking visualizations and graphics?
If yes, go with R. What about the problem you're trying to solve?
Machine learning stuff, go with Python, statistical learning R is your best bet.
And finally, what do most of your colleagues use?
Use that.
Ahhh, glad to get that off of my chest.
Now, we could all just finish here and go about our day, but I'd like to explain a little
bit more about what these two languages are and how they're best put to use.
Because increasingly the question isn't which to choose, but how to make the best use of
both programing languages for your specific use cases.
So let's start with the slightly older of the two, which is Python.
Now Python was released in 1989 and it's a general purpose object oriented programing
language that emphasizes code readability through its oh so generous use of whitespace
and it's super popular just behind Java and C in popularity in fact.
There are some awesome libraries that support data science tasks.
So for example, we have Numpty.
It's actually Numpy.
Numpty that's British slang for an idiot.
Numpty!
And numpty is used for large dimensional arrays and then for data manipulation, we have pandas.
There are also specialized tools for deep learning.
So you can use things like TensorFlow.
And you'll often find yourself working with Python in Jupyter notebooks.
As your I.D.E.
Now let's compare that to R, which is optimized for statistical analysis and data visualization.
So it was developed just a little later in 1992.
And as a rich ecosystem with complex data models and elegant tools for data reporting,
there are thousands of packages available via the Comprehensive R Archive Network, otherwise
known as CRAN, and these things are for deep analytical tasks.
R provides a broad variety of libraries and tools for things like cleansing data, creating
visualizations and training deep learning algorithms.
And our is commonly used with R studio, which is an integrated development environment for
simplified statistical analysis, visualization and reporting.
So both R and Python are open source and are supported by large communities continuously
extending their libraries and tools.
Really, the biggest differentiator is how they are used and are, as I've mentioned,
is mainly used for statistical analysis, while Python provides a more general approach to
data wrangling.
You might use R for customer behavior analysis and then you might use Python to build a facial
recognition application.
Now right up front, I said, if you have no programing experience or quite a lot of programing
experience, always the better bet.
If you fall somewhere in between then Python is easier to pick up, but how can that be?
Well, Python is multi-purpose.
It's considered a multi purpose language.
Much like C++ and Java, and it has a readable syntax that's easy to learn.
It's considered a good language for beginner programmers or those with experience in similar
languages.
Now, on the other hand, is built by statisticians and leans heavily into statistical models
and specialized.
Specialized analytics.
Now novices can be running data analysis tasks within minutes with just a few lines of code
using, but the complexity of advanced functionality makes it more difficult to develop expertize.
Now a few other considerations to keep in mind, and they all relate specifically to
data.
Now when it comes to data collection.
So actually gathering the data in the first place.
Python supports all kinds of data formats from comma separated value files or CSP files
that JSON sourced from the web.
In contrast, R is designed for data analysts to import data from things like Excel and
text files.
Now for data exploration, then you can use the PANDAS library to filter, sort and display
data in a matter of seconds.
If you use Python an R and the other hand is optimized for statistical analysis.
So you can build probability distributions or apply different statistical models.
And then finally, data modeling has some differences, too.
Python has libraries for data modeling like Numpty and R. You'll sometimes have to rely
on packages outside of R's core functionality that I see.
Finally, there's one more and that's visualization.
And with visualization R has the clear edge with a base graphics module allowing you to
easily create basic charts and plots.
And you can use ggplot2 for more advanced plots such as complex scatter plots with regression
lines are and Python have their strengths.
But in truth, most organizations use a combination of both languages.
You might conduct early stage data analysis and exploration and R and then switch to Python
when it's time to ship some data products.
So which should you use?
Both.
You're probably going to use a bit of both.
And if you want to see more videos like this in the future, please like and subscribe.
Thanks for watching.