This article focuses on comparing pandas with R, the statistical package on which much of pandas’ functionality is modeled. It is intended as a guide for R users who wish to use pandas, and for users who wish to replicate functionality that they have seen in the R code in pandas. It focuses on some key features available to R users and shows how to achieve similar functionality in pandas by using some illustrative examples. This article assumes that you have the R statistical package installed. If not, it can be downloaded and installed from here: http://www.r-project.org/.
By the end of the article, data analysis users should have a good grasp of the data analysis capabilities of R as compared to pandas, enabling them to transition to or use pandas, should they need to. The various topics addressed in this article include the following:
- R data types and their pandas equivalents
- Slicing and selection
- Arithmetic operations on datatype columns
- Aggregation and GroupBy
- Matching
- Split-apply-combine
- Melting and reshaping
- Factors and categorical data