paint-brush
NumPy Cheat Sheet: Data Analysis in Pythonby@kacawi
3,086 reads
3,086 reads

NumPy Cheat Sheet: Data Analysis in Python

by Karlijn WillemsJanuary 17th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

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 <a href="https://hackernoon.com/tagged/data-science" target="_blank">data science</a> 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.
featured image - NumPy Cheat Sheet: Data Analysis in Python
Karlijn Willems HackerNoon profile picture

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.