NumPy Cheat Sheet for Python Coding, Data / By Rahman NumPy is a library for the Python programming language which is used for working with multi-dimensional arrays and matrices. This is very useful in large scientific computing. NumPy / SciPy / Pandas Cheat Sheet Select column. Select row by label. Return DataFrame index. Delete given row or column. Pass axis=1 for columns. Reindex df1 with index of df2. Reset index, putting old index in column named index. Change DataFrame index, new indecies set to NaN. Show first n rows. Show last n rows.
NumPy is a library for the Python programming language which is used for working with multi-dimensional arrays and matrices. This is very useful in large scientific computing. Because NumPy ndarrays is way faster compared to a regular python list. Arrays are very frequently used in data science too, where speed and resources are very important. That’s why NumPy is a very handy tool in data-science.
But remembering all the NumPy commands might be overwhelming for both beginners and professionals. So Datalators makes the complex simple.
It’s also a good idea to check the official NumPy documentation from time to time. Even if you can find what you need in the cheat sheet. Reading documentation is a skill every data professional needs. Also, the documentation goes into a lot more detail than we can fit in a single sheet anyway!
Creating Arrays:
Import Export:
Numpy Array Cheat Sheet Excel
Inspecting Array:
Data Types:
Array Mathematics:
Statistics on NumPy:
Indexing and Slicing
Array Manipulation:
I hope this cheat sheet will be useful to you. No matter you are new to python who is learning python for data science or a data professional. Happy Programming.
You can also download the printable PDF file from here.
Python Array Cheat Sheet
Numpy Array Cheat Sheet Grade
The source code for NumPy is located at this GitHub repository.
You might also be interested in Pandas Cheat Sheet For Data Science In Python.