7 NumPy Basic Operations Every Beginner Should Know
When you start working with Python for AI, data science, or numerical problems, you eventually run into NumPy. At first, it looks pretty simple: create an array, print it, and you’re done. Then you actually start working with arrays and suddenly there are functions for changing their shape, resizing them, inserting elements, deleting them, joining them, splitting them… and you’re sitting there wondering, “Okay, which one am I actually supposed to use?”
I had the same confusion while learning the basics. So instead of throwing a huge list of functions at you, let’s focus on 7 basic NumPy operations that are genuinely useful for beginners. These are the kind of operations you’ll come across again and again when working with arrays.
If you’re completely new to arrays and want to understand the foundation first, you can also check out my earlier guide on [NumPy and its basics] before jumping into these operations.
Before we jump into these hands-on operations, if you’re still wondering why NumPy is so important for AI and Data Science, I’ve already covered that in my NumPy Basics guide, where I explain why NumPy was created, how it works behind the scenes, and why it is so widely used.
1. Creating an Array
Before performing any operation, we obviously need an array to work with. One of the first things you’ll learn in NumPy is how to convert a Python list into a NumPy array using np.array().
import numpy as np
numbers = np.array([10, 20, 30, 40, 50])
print(numbers)
Output:
[10 20 30 40 50]
Here, we first import NumPy using the commonly used alias np. Then np.array() converts our Python list into a NumPy array.
This might look like a very small thing, but it’s basically where most of your NumPy work begins. Once you have an array, you can perform different operations on it instead of manually working with individual values.
2. Accessing Elements Using Indexing

Once you’ve created an array, the next obvious question is: how do I access a particular element?
NumPy uses zero-based indexing, which means the first element has index 0, the second has index 1, and so on.
import numpy as np
numbers = np.array([10, 20, 30, 40, 50])
print(numbers[0])
print(numbers[3])
Output:
10
40
Here, numbers[0] gives us the first element, while numbers[3] gives us the fourth element.
You can also use indexing with two-dimensional arrays.
matrix = np.array([
[1, 2, 3],
[4, 5, 6]
])
print(matrix[1, 2])
Output:
6
The first index selects the row and the second selects the column. Since indexing starts from 0, [1, 2] means the second row and third column.
Indexing might look basic, but you’ll use it constantly while working with arrays and datasets.
3. Reshaping an Array

Now let’s say you have six elements in an array, but instead of keeping them in one row, you want to arrange them into two rows and three columns.
You don’t want to change the actual data. You just want to change its arrangement.
That’s exactly what reshape() does.
import numpy as np
numbers = np.array([1, 2, 3, 4, 5, 6])
new_array = numbers.reshape(2, 3)
print(new_array)
Output:
[[1 2 3]
[4 5 6]]
The original array had six elements, and the reshaped array still has six elements. We’ve simply changed its structure from 1 × 6 to 2 × 3.
This is an important rule to remember:
The total number of elements must remain the same when using reshape().
For example, six elements can become 2 × 3, 3 × 2, or 1 × 6, but not 2 × 4.
Think of it like rearranging the same books onto different shelves. The books haven’t changed; only their arrangement has.
4. Resizing an Array
This is where beginners often confuse reshape() and resize() because their names sound almost identical.
The easiest way to remember the difference is:
Reshape changes the arrangement. Resize can change the size.
Let’s look at an example.
import numpy as np
numbers = np.array([1, 2, 3, 4, 5, 6])
new_array = np.resize(numbers, (2, 4))
print(new_array)
Output:
[[1 2 3 4]
[5 6 1 2]]
Our original array had only six elements, but we asked for a 2 × 4 array, which requires eight elements.
NumPy fills the additional positions by repeating values from the original array.
That’s why the result contains:
1 2 3 4
5 6 1 2
So while reshape() requires the same number of elements, resize() can create a different-sized array.
A simple way to remember it:
reshape → rearrange
resize → change size
Once you understand this difference, these two functions become much easier to remember.
5. Inserting Elements
What if you already have an array but want to add a value at a specific position?
That’s where np.insert() comes in.
import numpy as np
numbers = np.array([10, 20, 30, 40])
new_array = np.insert(numbers, 2, 25)
print(new_array)
Output:
[10 20 25 30 40]
Here, 2 is the index where we want to insert the value, and 25 is the value being inserted.
The original array was:
[10 20 30 40]
After inserting 25 at index 2, we get:
[10 20 25 30 40]
Notice something important: np.insert() returns a new array.
print(numbers)
The original array is still:
[10 20 30 40]
So don’t assume that the original array has automatically changed.
6. Deleting Elements

Just like we can insert elements, we can also remove them.
NumPy provides np.delete() for this.
import numpy as np
numbers = np.array([10, 20, 30, 40, 50])
new_array = np.delete(numbers, 2)
print(new_array)
Output:
[10 20 40 50]
Here, index 2 refers to the third element, which is 30. So NumPy removes that element and returns a new array.
Again, the original array remains unchanged unless you assign the result back to a variable.
This is useful to remember because beginners often expect np.delete() to directly modify the original array.
7. Joining and Splitting Arrays
Now imagine that your data is stored in two different arrays, but you want to combine them into one.
That’s where joining comes in.
One common way to join arrays is np.concatenate().
import numpy as np
array1 = np.array([1, 2, 3])
array2 = np.array([4, 5, 6])
combined = np.concatenate((array1, array2))
print(combined)
Output:
[1 2 3 4 5 6]
Here, two separate arrays have been combined into one.
But sometimes we need to do the opposite. Instead of combining arrays, we may want to divide one array into smaller parts.
That’s where np.split() comes in.
numbers = np.array([1, 2, 3, 4, 5, 6])
parts = np.split(numbers, 3)
print(parts)
Output:
[array([1, 2]), array([3, 4]), array([5, 6])]
Here, the original array is divided into three smaller arrays.
So you can remember it like this:
concatenate → join arrays
split → divide an array
These operations become particularly useful when you’re working with datasets where information may be stored in different sections or needs to be divided for processing.
Final Thoughts

And that’s it — seven NumPy operations that are worth knowing when you’re starting out.
You don’t need to memorize every NumPy function you come across. In fact, trying to memorize everything is probably one of the fastest ways to make programming unnecessarily difficult. It’s much more useful to understand what an operation does and, more importantly, when you would actually use it.
The biggest thing to notice is that some operations can look confusingly similar. reshape() and resize() are a perfect example. One rearranges the existing elements while keeping their total count the same, whereas the other can change the size of the array. Similarly, insert() and delete() let you manipulate array contents, while concatenate() and split() help you work with multiple pieces of data.
And honestly, don’t just read these examples and move on. Open your Python environment, create a small array, change something, break something, and see what happens. That’s when these functions actually start sticking in your head.
Because learning NumPy isn’t really about memorizing seven functions.
It’s about getting comfortable with manipulating data.
Once that starts feeling natural, you’re ready to move toward more interesting things like mathematical operations, statistical functions, matrices, and eventually using NumPy with libraries such as Pandas and Scikit-learn.
Sources
- NumPy Documentation — The Basics
NumPy — The Basics - NumPy Documentation — Array Manipulation Routines
NumPy — Array Manipulation Routines - NumPy Documentation — Indexing on ndarrays
NumPy — Indexing on ndarrays - NumPy Documentation — Joining Arrays
NumPy — Joining Arrays