Bitwise-Operators
# https://www.scientecheasy.com/2022/10/bitwise-operators-in-python.html/
# https://chatgpt.com/share/678524a9-cd24-8012-a475-2b7098cd8750
# Bitwise Operators in Python
# & Bitwise AND Binary
# | Bitwise OR Binary
# ^ Bitwise XOR (Exclusive OR) Binary
# ~ Bitwise NOT Unary
# << Bitwise Left Shift Binary
# >> Bitwise Right Shift Binary
# Bitwise AND operator (&)
Read More
Calling-A-Function
# https://www.scientecheasy.com/2022/12/calling-a-function-in-python.html/
# Execution Style of Calling a Function in Python
# Function definition.
def funct_name(): # function header.
print('This function does not contain any parameter.')
# Main program execution started from here.
funct_name() # function calling.
This function does not contain any parameter.
Read More
Class-Keyword
# https://www.scientecheasy.com/2022/09/reserved-keywords-in-python.html/
# example for a class declarstion
class ClassExample:
def func1(parameters):
. . . .
def func2(parameters):
. . . .
with open('myfile.txt', 'w') as file:
file.write('Hi jerin!')
Read More
Class-Object
class Car:
def __init__(self, brand, model):
self.brand = brand
self.model = model
def display_info(self):
print(f"Car Brand: {self.brand}, Model: {self.model}")
my_car = Car("Toyota", "Corolla") # ---> this is the object for that class
my_car.display_info()
Car Brand: Toyota, Model: Corolla
Score: 0
Read More
Collection-Literals
# https://www.scientecheasy.com/2022/09/literals-in-python.html/
# Collection literals in Python
address = ['Scientech Easy', 'Joraphatak Road', 'Dhanbad']
['Scientech Easy', 'Joraphatak Road', 'Dhanbad']
num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
[1, 2, 3, 4, 5, 6, 7, 8 …
Read More
Correlation-1
import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: py311; pyv: 3.11.9 (main, Apr 19 2024, 16:48:06) [GCC 11.2.0]'
# necessary modules
import pandas as pd
import numpy as np
def histogram_intersection(a, b):
v = np.minimum(a …
Read More