NumPy Cheat Sheet: Data Analysis in Python

Written by kacawi | Published 2017/01/17
Tech Story Tags: data-science | machine-learning | python | data-analysis

TLDRvia the TL;DR App

Given the fact that it’s one of the fundamental packages for scientific computing, NumPy is one of the packages that you must be able to use and know if you want to do data science with Python. It offers a great alternative to Python lists, as NumPy arrays are more compact, allow faster access in reading and writing items, and are more convenient and more efficient overall.

In addition, it’s (partly) the fundament of other important packages that are used for data manipulation and machine learning which you might already know, namely, Pandas, Scikit-Learn and SciPy:

  • The Pandas data manipulation library builds on NumPy, but instead of the arrays, it makes use of two other fundamental data structures: Series and DataFrames,
  • SciPy builds on Numpy to provide a large number of functions that operate on NumPy arrays, and
  • The machine learning library Scikit-Learn builds not only on NumPy, but also on SciPy and Matplotlib.

You see, this Python library is a must-know: if you know how to work with it, you’ll also gain a better understanding of the other Python data science tools that you’ll undoubtedly be using.

This cheat sheet means to give you a good overview of the possibilities that this library has to offer.

Go and check it out for yourself!

NumPy Cheat Sheet

Download the cheat sheet here: https://www.datacamp.com/community/blog/python-numpy-cheat-sheet

You’ll see that this cheat sheet covers the basics of NumPy that you need to get started: it provides a brief explanation of what the Python library has to offer and what the array data structure looks like, and goes on to summarize topics such as array creation, I/O, array examination, array mathematics, copying and sorting arrays, selection of array elements and shape manipulation.

NumPy arrays are often preferred over Python lists, and you’ll see that selecting elements from arrays is very similar to selecting elements from lists.

Do you want to know more? Check out DataCamp’s Python list tutorial.

PS. Don’t miss our other Python cheat cheets for data science that cover Scikit-Learn, Bokeh, Pandas and the Python basics.

Originally published at www.datacamp.com.


Published by HackerNoon on 2017/01/17