Data science I - Power up your NumPy array skills( Basics)
The first and foremost thing you need to get started in the data science and machine learning world is to have a little bit of knowledge of Python/ R. And I already know a little bit of Python and have worked on it for some time in the past, I will be choosing it over R.
What are we going to learn today?
2. Introduction to Numpy
3. NumPy vectors and matrices creation and library methods
4. Selecting data using Numpy Array Indexing/ Positioning
5. Learning about Numpy operations available
pip install jupyter
python3notebook from the
newbutton on the right hand side.
Introduction to NumpyNumPy is a Linear Algebra Library for Python. This particular library can be used to make all sorts of maths related computations in python. Also, they are blazingly fast because it is executed with pre compiled
Ccode. It is also important because almost all the libraries of PyData ecosystem are somehow dependent on NumPy library. You can install NumPy using
pip. While in the newly created jupyter notebook, go to the first shell and use the following command.
!pip install numpy
shift + return( Enter). We will mostly be using the NumPy arrays to interact with the data. There are a few terminologies we need to be aware of before moving forward.
- Vectors: These are the 1-d arrays.
- Matrices: These are the 2-d arrays but can have 1 row or 1 column as well.
npto save time, you can use the same standard or prefer to stay away from it as well.
import numpy as np
NumPy vectors and matrices creation and library methodsLet’s move to the jupyter notebook for the further discussions of numpy. In this jupyter notebook, we are going to create
NumPyvectors and matrices using different methods. We are also going to talk about different basic methods that will play an important role while performing different tasks on data sets. Numpy learning jupyter notebook
Selecting data using Numpy Array Indexing/ PositioningAll these methods are used to select specific parts and particular element from the NumPy arrays. Let’s move to the jupyter notebook and continue the tutorial up there. In this part, we are going to learn about selecting different parts of the np arrays. Along with some basic conditional selecting, where you select certain parts using some specific conditions. Numpy Selection Jupyter Notebook
Learning about Numpy operations availableNumpy operation can help us do different operation on the elements of the
nparrays and give us the desired results. In this jupyter notebook, we will be talking about the 3 types of operations.
- Vector Operations
- Scalar Operations
- Universal Operators
Did you enjoy reading or think it can be improved? Don’t forget to leave your thoughts in the comments section below! If you liked this article, please share it with your friends, and read a few more!