Python for R Users
Table of Contents
Meet your instructor
Bereket Kindo, PhDLessons
-
Indexing and slicing R vectors and Python arrays
Indexing allows you to select a subset of elements in a given object containing a sequence of data elements. You can index a vector in R and a numpy array in Python by using square brackets [] and specifying the indices of the elements you want to extract.