Magnetic separation of different types of magnetic ores
Designing my own house
Wrench modeling by own thought
As usal wrench
import pandas as pd
# Load the Excel file into a DataFrame
# Replace 'dye_degradation_data.xlsx' with the path to your Excel file
data = pd.read_excel('dye_degradation_data.xlsx', sheet_name='Dye_Degradation')
# Display the first few rows to ensure it's loaded correctly
print(data.head())
# Check the structure and types of the data
print(data.info())
# Summary statistics of the data
print(data.describe())
# Example: Basic regression analysis
# Importing statsmodels for regression analysis
import statsmodels.api as sm
# Define the independent variables (X) and dependent variable (Y)
X = data[['Time (min)', 'pH', 'Initial Concentration (ppm)', 'Temperature (°C)']]
Y = data['Removal Efficiency (%)']
# Add a constant to the independent variables matrix (intercept)
X = sm.add_constant(X)
# Fit the regression model
model = sm.OLS(Y, X).fit()
# Output the regression results
print(model.summary())
# Example: Making predictions with the model (optional)
# You can create a new data point to predict removal efficiency
new_data = pd.DataFrame({
'const': [1], # Intercept term
'Time (min)': [45],
'pH': [9],
'Initial Concentration (ppm)': [60],
'Temperature (°C)': [28]
})
# Predict removal efficiency for the new data point
predicted_efficiency = model.predict(new_data)
print("Predicted Removal Efficiency:", predicted_efficiency)
class Student:
def __init__(self, name, score):
self.name = name
self.score = score
self.passed = False
def calculate_result(self, passing_threshold=60):
if self.score >= passing_threshold:
self.passed = True
def get_student_data():
name = input("Enter student name: ")
score = float(input("Enter student score: "))
return name, score
def main():
num_students = int(input("Enter the number of students: "))
students = []
for _ in range(num_students):
name, score = get_student_data()
student = Student(name, score)
students.append(student)
total_score = 0
for student in students:
total_score += student.score
average_score = total_score / num_students
print(f"\nAverage score: {average_score:.2f}\n")
passing_threshold = 60
print("Results:")
for student in students:
student.calculate_result(passing_threshold)
result = "Passed" if student.passed else "Failed"
print(f"{student.name}: {result}")
if __name__ == "__main__":
main()
#Bank system
import time
balance = 500
restart = 0
chances = 3
pin = 1234
print("Welcome to bank")
dial=input("Dial: ")
if dial == "*420#":
while restart not in ("n","N"):
print("1.Information")
print("3.Cash Out")
print("4.Cash In")print("2.Balance")
print("5.Logout")
option=int(input("Enter Your Option: "))
if option==1:
print("Name: Md Dipu Malitha\nID:70748463836\n")
restart=int(input("Would you want come back?\nPress 0 "))
if restart in ("n",'No'):
print("Thank You")
break
elif option==2:
password=int(input("Enter your pin Number: "))
if pin == password:
print (f"Your current account Balance is {balance} tk.")
restart = int(input("Would you want come back?\nPress 0 "))
if restart in ("n", 'No'):
print("Thank You")
break
elif option==3:
send_number = int(input("Enter account Number: "))
cash_out=int(input("Amount: "))
password = int(input("Enter your pin Number: "))
if password==pin:
if cash_out>balance:
print("Insufficient balance")
else:
balance=balance-cash_out
print("You have Cashed out ",cash_out)
print(f"Cash out Tk {cash_out} to {send_number} successful. Your Remaining Balance is {balance} TK.Your tran time : {time.time()}" )
restart = int(input("Would you want come back?\nPress 0 "))
if restart in ("n", 'No'):
print("Thank You")
break
elif option==4:
cash_in=int(input("Cash in Amonut: "))
balance=balance+cash_in
print("Your Current banlance is ",balance)
restart = int(input("Would you want come back?\nPress 0 "))
if restart in ("n", 'No'):
print("Thank You")
break
elif option == 5:
print("Thank You")
break
else:
print("Invaild Number")
#Area of triangle & rectangle
class shape():
def __init__(self,base,height):
self.base=base
self.height=height
class triangle(shape):
def area(self):
area= 0.5*self.base*self.height
print("Area is : ", area)
class rectangle(shape):
def area(self):
area= self.base*self.height
print("Area is : ", area)
class square(shape):
def area(self):
area=self.base*self.height
print("area is : ", area)
s=square(10,10)
s.area()