using scipy' genfromtxt()we can easily read in the data import scipy as sp data sp genfromtxt("web_traffic tsv"delimiter="\ "we have to specify tab as the delimiter so that the columns are correctly determined quick check shows that we have correctly read in the data print(data[: ][ + + + nan + + + + + + + + + + + + + + + + ]print(data shape( we have data points with two dimensions preprocessing and cleaning the data it is more convenient for scipy to separate the dimensions into two vectorseach of size the first vectorxwill contain the hours and the otherywill contain the web hits in that particular hour this splitting is done using the special index notation of scipyusing which we can choose the columns individually data[:, data[:, there is much more to the way data can be selected from scipy array check out for more details on indexingslicingand iterating one caveat is that we still have some values in that contain invalid valuesnan the question iswhat can we do with themlet us check how many hours contain invalid data sp sum(sp isnan( )