Submit a blog to KDnuggets -- Top Blogs Win A Reward

Topics: AI | Data Science | Data Visualization | Deep Learning | Machine Learning | NLP | Python | R | Statistics

KDnuggets Home » News » 2020 » Dec » Tutorials, Overviews » R or Python? Why Not Both? ( 20:n47 )

Silver BlogR or Python? Why Not Both?


Do you use both R and Python, either in different projects or in the same? Check out prython, an IDE designed to handle your needs.



Forget the R vs. Python flame wars.

What about actual practical scenarios where using both might be warranted?

What if a data science or analysis team is made up of a number of individuals with expertise in both languages? What if a system is being designed leveraging libraries and packages in the ecosystems which grew out of both base languages? What if a particular use cases demands that one particular piece of an implementation strays from the language of the rest of the product?

And what if you want to implement and manage this disparate code using a single IDE?

Or what if you use both R and Python in separate projects and simply want a single workspace in which to write all of your code?

Enter prython, an IDE designed for coding in both R and Python, even within the same project.

Image

 

prython is a novel IDE that allows you to code in R or Python (you can even use both within the same project) by connecting panels in a canvas. It allows you to organise your code, perform experiments that run with one click, and visualise your plots+dataframes next to the panel that created them. Tired of remembering which lines need to commented out to test something? Or do you just want to organise your code better? Currently available for Windows, and runs with your local R/Python kernels.

 

The project's pros are all related to the ease of integrating Python and R programming environments, including no-code features for input and output flow management, data visualizations, spinning up context consoles at various spots within the project flow, mixed dataframe inspection, and more.

The major con is that prython currently only runs in Windows.

If you are a Windows user, however, and you can get prython here.

Image

 

prython is based on the notion of panels which can be connected to one another on a canvas, with each panel running Python or R code. Panels have connections, both input and output, and these interconnections can be configured and reconfigured as needed. Panels can run independently, or in tandem with the panels which come before or after it. Why bother with panels at all?

Data professionals need to experiment with their data, build tons of plots, and separate the code into different areas. They rarely want to have a single linear script that runs from start to end. This almost inevitably leads to very messy scripts, unclear outputs, multiplicity of confusing plots, and users needing to remember what needs to be commented out to test something. No other IDE is well suited for this.

 

Some typical reasons to want to use prython, according to its website:

  • To track and describe experiments and tests. Instead of remembering what needs to be commented out in a script to test X change, you can easily do that with prython
  • to display your results and plots in a canvas that can be seen at the same time
  • to run complex tests on different models that run with a single click (for example: you want to test several scikit-learn models at the same time)
  • to split your code into different areas in the canvas. ie. input loading on one part of the canvas, model training in another area, plots/analysis in a different area
  • to mix Python and R code within the same project.
  • to visualize how dataframes change and evolve in a script. prython computes all changes done to dataframes (both in R or Python) across panels, and whenever a dataframe is altered, it is shown as a table next to each panel

 

A brief high-level introduction to prython is available in this video:


 

The project's website contains additional video tutorials as well as adequate documentation to get the IDE up and running and to start being productive with it.

The days of arguing about which of these are the one language to rule them all are done, but that doesn't mean that either one is the "winner." Python and R are 2 tools that can be used to accomplish your data science or data analysis goals, and setting your goals based on the tools you are using is counterproductive. So use either — or both — and have a look at prython to see if its unique approach to a data science-centric IDE can make you more productive. After all, getting out of the way and allowing you to be productive is what your tools are supposed to do.

 
Related:


Sign Up

By subscribing you accept KDnuggets Privacy Policy