R vs. Python: Analysis Based on Data from Stack Overflow

Chuan Hong
Posted on Nov 7, 2016

Contributed by Chuan Hong. Chuan is currently in the NYC Data Science Academy 12 week full-time Data Science Bootcamp program taking place between September 26th to December 23rd, 2016. This post is based on her class project - R  Shiny.

Motivation

Both R and Python are widely used programming languages for data analysis ranging from basic statistics and visualization to complex model analysis. I am curious about "which is more popular: R or Python?". Thus, I created an app to visualize the popularity of R versus Python based on data from Stack Overflow over the past six years.

Data Source and Processing

Data were from kaggle, R Questions from Stack Overflow and Python Questions from Stack Overflow. Stack Overflow is the largest online community for programmers to learn, share their knowledge, and advance their career. The table below shows the raw data from kaggle. The data of R or Python was organized in three tables: Questions, Answers, and Tags. Full text of questions and answers from Stack Overflow that are tagged with the "Tags", useful for natural language processing and community analysis.

var_raw

Next, since we only cared about the number of questions and answers for each language, we nailed down to the following variables in each table.

var_processing

In order to separate the "Tags" into "packages" and "topics", I also scraped a list of R packages from CRAN Packages By Name, and a list of Python packages from PyPI Ranking as well.

 Visualizations

  • Summary of R & Python

    First, let's look at the aggregated number of users and the number of questions/answers. The bar chart below shows that more users posted questions/answers related to Python than users posting about R. Similarly, the total number of questions/answers of Python is greater than that of R.

    summary-of-r-python

  • Time Trend: R vs. Python

    The video below shows how to check the time trend of R or Python with different items. For example, we can see how the number of users posting questions and the number of questions of  R or Python changed from 1/15/2000 to 9/15/2016. Obviously, both of R and Python was increasing during the past six years, and the number of users asking questions about Python (n=9441) is greater than that about R (n=2612).

  • Topics:  R versus Python

    Next, let's look at the findings about packages and topics. The most popular topics of R are dataframe, plot, loops, regex, and function.

    topics_r

    Based on the graph below, we can see the most popular topics of Python are python 2.7, python 3.x, list, dictionary, and tkinter.

    topics_pythons

  • Packages: R versus Python

    The most popular packages of R are ggplot2, shiny, data.table, dplyr, and list.packages_r

    The most popular packages of Python are django, panadas, numpy, matplotlib, and regex.

    packages_pythons

About Author

Chuan Hong

Chuan Hong

Chuan Hong is a Ph.D. Candidate majoring in Public Health at the University of South Carolina. Her main research areas are environmental health sciences, with a focus on environmental epidemiology. By using a series of data collection, statistical...
View all posts by Chuan Hong >

Leave a Comment

Avatar
blog names examples December 13, 2017
It works as a website cms, but gives you plenty of treatments for what the blog will look like and how it'll function. You can sell t-shirts and bags that are branded together with your blog's logo to improve some income. Writing blog articles can be a way for you to channel knowing about it and creativity while using world.
Avatar
Chuan Hong March 7, 2017
Hi Victor, Thanks for liking my project. I used googleVis library to make this "Motion Chart". Here's an introduction regarding "visualization: Motion Chart" https://developers.google.com/chart/interactive/docs/gallery/motionchart. I hope this will help :)
Avatar
Victor February 16, 2017
Hi Chuan, Nice article. Thank for the insights. What library did you use do generate the Time Trend R x Python in the video. Was it R Shiny? Thanks

View Posts by Categories


Our Recent Popular Posts


View Posts by Tags

#python #trainwithnycdsa 2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python python machine learning python scrapy python web scraping python webscraping Python Workshop R R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp