July 2018
Beginner to intermediate
406 pages
9h 55m
English
It is more convenient for SciPy to separate the dimensions into two vectors, each the size of 743 data points. The first vector, x, will contain the hours, and the other, y, will contain the web hits in that particular hour. This splitting is done using the special index notation of SciPy, by which we can choose the columns individually:
x = data[:,0]y = data[:,1]
There are many more ways in which data can be selected from a SciPy array. Check out https://docs.scipy.org/doc/numpy/user/quickstart.html for more details on indexing, slicing, and iterating.
One caveat is that we still have some values in y that contain invalid values, such as nan. The question is what we can do with them. Let's check how many ...
Read now
Unlock full access