Machine Learning
Machine Learning
exe
Open command prompt
Install numpy by typing “pip install numpy”
Create a folder named as “pyeg” using command
For Windows type: “md pyeg”
For Linux type: “mkdir pyeg”
Create a file named as “eg1.py” using below command
For Windows type: “notepad eg1.py”
For Linux type: “gedit eg1.py” or “nano eg1.py” or “vim eg1.py”
Type the below program, save it and run using “python eg1.py” or “py eg1.py”
Program:
# Mean (Average)
data = [12, 15, 18, 20, 22] # Sample dataset
mean_value = statistics.mean(data) # Calculate mean
print("Mean:", mean_value) # Output the result
print("--------------------------------------------------")