NumPy ndarray.__ilshift__() | Shift NumPy Array Elements to Left Last Updated : 05 Feb, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report The ndarray.__ilshift__() method is an in-place left-shift operation. It shifts elements in the array to the left of the number of positions specified. Example Python3 import numpy as np gfg = np.array([1, 2, 3, 4, 5]) # applying ndarray.__ilshift__() method print(gfg.__ilshift__(2)) Output[ 4 8 12 16 20] SyntaxSyntax: ndarray.__ilshift__($self, value, /) Parameters self: The numpy array.value: The number of positions to shift.Return: The array with its elements shifted left side How to Shift Elements of NumPy Array to the leftTo shift the elements of the NumPy Array to the left we use ndarray.__ilshift__() method of the NumPy library in Python. Let's understand it better with an example: Example: Python3 # import the important module in python import numpy as np # make an array with numpy gfg = np.array([[1, 2, 3, 4, 5], [6, 5, 4, 3, 2]]) # applying ndarray.__ilshift__() method print(gfg.__ilshift__(1)) Output[[ 2 4 6 8 10] [12 10 8 6 4]] Comment More infoAdvertise with us Next Article NumPy ndarray.transpose() Method | Find Transpose of the NumPy Array J jitender_1998 Follow Improve Article Tags : Python Python-numpy Python numpy-ndarray Practice Tags : python Similar Reads NumPy ndarray.__irshift__() | Shift NumPy Array Elements to Right The ndarray.__irshift__() method returns a new array where each element is right-shifted by the value that is passed as a parameter. Example Python3 import numpy as np gfg = np.array([1, 2, 3, 4, 5]) # applying ndarray.__irshift__() method print(gfg.__irshift__(2)) Output[0 0 0 1 1] SyntaxSyntax: nd 1 min read NumPy ndarray.tolist() Method | Convert NumPy Array to List The ndarray.tolist() method converts a NumPy array into a nested Python list. It returns the array as an a.ndim-levels deep nested list of Python scalars. Data items are converted to the nearest compatible built-in Python type. Example Python3 import numpy as np gfg = np.array([1, 2, 3, 4, 5]) print 1 min read Python | Numpy numpy.ndarray.__lshift__() With the help of Numpy numpy.ndarray.__lshift__() method, we can get the elements that is left shifted by the value that is provided as a parameter in numpy.ndarray.__lshift__() method. Syntax: ndarray.__lshift__($self, value, /) Return: self<<value Example #1 : In this example we can see that 1 min read NumPy ndarray.byteswap() Method | Swap bytes of the Array Elements The ndarray.byteswap() method swaps the bytes of the array elements. It toggles between low-endian and big-endian data representation by returning a byteswapped array, optionally swapped in-place. Note: byteswap() method does not work on arrays of strings. ExamplePython3 # Python program explaining 2 min read NumPy ndarray.transpose() Method | Find Transpose of the NumPy Array The ndarray.transpose() function returns a view of the array with axes transposed. For a 1-D array, this has no effect, as a transposed vector is simply the same vector.For a 2-D array, this is a standard matrix transpose.For an n-D array, if axes are given, their order indicates how the axes are pe 2 min read Python | Numpy MaskedArray.__ilshift__() numpy.ma.MaskedArray class is a subclass of ndarray designed to manipulate numerical arrays with missing data. With the help of Numpy MaskedArray.__ilshift__we can get the elements that is left shifted by the value that is provided as a parameter in the MaskedArray.__ilshift__() method. Syntax: nump 1 min read Like