Numpy Arrays

Numpy arrays are preferred to traditional lists because they allow for additional subsetting that traditional lists do not provide. Numpy is short form for numerical python which is used for calculating a lot of numeric and scientific approaches in python. A beautiful thing on numpy is that they are the basis of pandas which is used for most data science, data analysis and machine learning modelling. Understanding numpys provide many benefits

Two reasons to use numpy arrays:

  • numpy arrays expect homogenous values, so it allows efficiency over traditional python lists

  • numpy arrays also allow for easy boolean indexing over traditional lists.

In conclusion, when using lists, use numpy array for more efficiency and robustness.