## Remove Last Element From Numpy Array

In this tutorial, we will look at how to remove the last element from a Numpy array with the help of some examples. How do I remove the last element of a Numpy Array? You can use the numpy delete() function to remove the last element of a numpy array. The following is the syntax …

## Remove First Element From Numpy Array

In this tutorial, we will look at how to remove the first element from a Numpy array with the help of some examples. How do I remove the first element of a Numpy Array? You can use the numpy delete() function to remove the first element of a numpy array. Pass 0 as the index …

## Calculate Percentile in Python

Percentiles are descriptive statistics that tell us about the distribution of the values. The nth percentile value denotes that n% of the values in the given sequence are smaller than this value. For example, the 25th percentile value is the value that is greater than 25% of the values present in the data. In this …

## Numpy – Set difference between two arrays

The set difference operation is used in sets to find elements in one set that are not present in the other set. For example, for two sets a and be, a-b results in a set with elements of set a that are not present in set b. In this tutorial, we will look at how …

## Python – Get union of two numpy arrays

In this tutorial, we will look at how to get the union of two numpy arrays with the help of some examples. Numpy union1d() Function You can use the numpy union1d() function to find the union of two arrays. Pass the two arrays as arguments to the function. The following is the syntax: It returns …

## Python – Get Intersection of Two Numpy Arrays

In this tutorial, we will look at how to get the intersection of elements between two numpy arrays with the help of some examples. Numpy intersect1d() Function You can use the numpy intersect1d() function to get the intersection (or common elements) between two numpy arrays. If the input arrays are not 1d, they will be …

## Vertically split numpy array with vsplit()

In this tutorial, we will look at the numpy vsplit() function and its usage with the help of some examples. What is does numpy vsplit() do? The numpy vsplit() function is used to split a numpy array into multiple sub-arrays vertically (row-wise). Pass the input array and the number of sub-arrays as arguments. The following …

## Horizontally split numpy array with hsplit()

In this tutorial, we will look at the numpy hsplit() function and its usage with the help of some examples. What does numpy hsplit() do? The numpy hsplit() function is used to split a numpy array into multiple sub-arrays horizontally (column-wise). Pass the input array and the number of sub-arrays as arguments. The following is …

## Get unique values and counts in a numpy array

In this tutorial, we will look at the numpy unique() function and its use-cases with the help of some examples. How to get unique values in a numpy array? You can use the numpy unique() function to get the unique values of a numpy array. Pass the array for which you want the get the …

## Trim zeros from a numpy array in Python

In this tutorial, we will look at how to trim zeros in python from a numpy array with the help of some examples. What is numpy trim_zeros()? The trim_zeros() function in numpy is used to trim leading and/or trailing zeros from a one-dimensional numpy array or sequence. The following is the syntax. Here, “flit” is …