R and Python Basics
Start here

Ten lessons that take you from your first line of code to the libraries analytics runs on. Every example runs inside this page — nothing to install, no sign-up. Each worked example is followed by a Try here box where you type your own code and run it.
TipBefore you start
The first lesson you open takes a few seconds to load the R or Python engine into your browser. The NumPy, pandas and SciPy lessons load the most, so give them a moment on a slow connection.
R Basics
- Overview of R and RStudio — what R is, installing it, and the RStudio panels
- Data Structures — data types, assignment, vectors, matrices and data frames
- Functions — built-in functions and writing your own
- Statements and Looping — logical operators,
if, and loops
Python Essentials
- Understanding Python — why Python for analytics, and how it compares with R
- Data Types — numbers, strings, lists, tuples, dictionaries and sets
- Operators — assignment, arithmetic, comparison and logical operators
- NumPy — arrays, indexing and vectorised maths
- pandas — Series, DataFrames, cleaning and summarising data
- SciPy — descriptive statistics and statistical tests
These lessons are Module I of Business Analytics for Decision Making, free to read in full.