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 packbits Code Packed array along default axis 
Python :: NumPy unpackbits Code Unpacked array along axis 1 
Python :: WAP to input 3 no.s and print their sum. 
Python :: django view - mixins and GenericAPIView (list or create - GET, POST) 
Python :: django filter empty onetoone exists 
Python :: free konta mc 
Python :: # convert dictionary keys to a list 
Python :: taking str input in python and counting no of it 
Python :: Python PEP (class) 
Python :: xampp python 
Python :: Double all numbers using a map() and Lamda Function 
Python :: how to stop python file using batch file 
Python :: displaying print output in a textbox 
Python :: python how do I count the time that it takes for the sorting to execute in seconds? [closed] 
Python :: how to create function python 
Python :: python re return index of match 
Python :: sqlite basic 
Python :: How to query one to many on same page 
Python :: python tuple index access 
Python :: Retry function for sending data 
Python :: python discord next page 
Python :: ring PostgreSQL load the postgresqllib.ring library 
Python :: how to add log to a variable in plotly 
Python :: convert all date columns using pd.datetime 
Python :: element wise mean and std 
Python :: how to add illegal characters to paths python 
Python :: attribute error rest framework 
Python :: gspread how to put shhet number in a variable 
Python :: arrays with name instead of index python 
Python :: populate initial data for django simple history 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =