SAS is the analytics sledgehammer of yesteryear. It was the market leader in analytics solutions before R and Python, the poster boys of the open source movement, dethroned it from its numero uno position. Nevertheless, many enterprises still trust it with all their analytics requirements, despite the unreasonably high costs.
In this section, we will keep all the comparisons to a tabular format. The SAS and pandas equivalents are summarized in the following table:
Pandas |
SAS |
DataFrame |
dataset |
column |
variable |
row |
observation |
groupby |
BY-group |
NaN |
. |
Now, let's see how we can perform the basic data operations in pandas and SAS:
Task |
Pandas |
SAS |
Creating a dataset |
pd.DataFrame({'odds': [1, 3, 5, 7, 9], 'evens': [2, 4, 6, 8, 10]}) |
data df; input x y; datalines; ... |