8: Arrays in Python (1 of 2)
- Page ID
- 39389
There are several candidates in the Python language for representing the type of array structure we introduced in chapter 7. One is the plain-ol’ Python list, which you may have used if you’ve taken a computer science course in Python. Turns out, lists are going to be too slow for us once we start dealing with a lot of data, plus there are a lot of things that it won’t do for us automatically that are handy to have. Another choice is the Pandas Series which we’ll actually introduce in chapter 11 – oddly, that one turns out to do too much, rather than too little, for our purposes here. A happy medium is the ndarray from the NumPy package1 . Before we do that, however, we need to learn what a “package” actually is, and how to use one.
1Most people seem to pronounce this “NUM-pie,” although I’ve heard “NUM-pee” as well. Pick your poison.