Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

NumPy left_shift Code When inputs and bit shift are numbers

# welcome to softhunt.net
# Python program explaining
# left_shift() function

import numpy as np
num = 3
bit_shift_num = 2

print ("Input number : ", num)
print ("Number of bit shift : ", bit_shift_num )
	
ans = np.left_shift(num, bit_shift_num)
print ("After left shifting 2 bit : ", ans)
Comment

NumPy left_shift Code When inputs and bit shift are an arrays

# welcome to softhunt.net
# Python program explaining
# left_shift() function

import numpy as np

arr = [21, 15, 43]
bit_shift_arr =[2, 3, 4]

print ("Input array : ", arr)
print ("array of bit shift : ", bit_shift_arr )
	
ans = np.left_shift(arr, bit_shift_arr)
print ("After left shifting 2 bit : ", ans)
Comment

NumPy right_shift Code When inputs and bit shift are an arrays

# welcome to softhunt.net
# Python program explaining
# right_shift() function

import numpy as np

arr = [21, 15, 43]
bit_shift_arr =[2, 3, 4]

print ("Input array : ", arr)
print ("array of bit shift : ", bit_shift_arr )
	
ans = np.right_shift(arr, bit_shift_arr)
print ("After right shifting 2 bit : ", ans)
Comment

PREVIOUS NEXT
Code Example
Python :: NumPy unpackbits Syntax 
Python :: Convertion of number into binary using NumPy binary_repr 
Python :: pymenu example 
Python :: django view - Generic class based view (listc, create, retrieve, update or delete - GET, POST, GET, PUT, DELETE) 
Python :: should either include a `queryset` attribute, 
Python :: qt list widget let editable 
Python :: #check if the given date is a weekday or weekend 
Python :: how to take input as an integer in python 
Python :: python decouple default value 
Python :: Use PIP from inside script 
Python :: extract numbers from image python 
Python :: how can I edit the history in python shell 
Python :: How to use a <ComboboxSelected virtual event with tkinter 
Python :: parsing output from ping - python 
Python :: create multiple marks python for python 
Python :: selsearch 
Python :: how do i access individual elements of matrix in python? 
Python :: HTML default value fo radio button input type based on python variable 
Python :: singke line expresions python 
Python :: django add list to manytomany 
Python :: discord.py main file setup 
Python :: ring write the same example using normal for loop the Encrypt() and Decrypt() functions. 
Python :: list slicing 
Python :: python adx indicator 
Python :: talib 
Python :: Find the 15th term of the series?0,0,7,6,14,12,21,18, 28 
Python :: foreign key on delete arguments 
Python :: python class overwrite length method 
Python :: commanding ip camera(onvif-ptz-control-python) 
Python :: python multilevel list comprehension 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =