?print-pdf
' Created for
# Create
python -m venv .venv
# Activate (CMD)
.venv\Scripts\activate.bat
pip install numpy pandas matplotlib seaborn scikit-learn
pip install jupyterlab
import numpy as np
# Create a NumPy array
array = np.array([1, 2, 3, 4, 5])
print(array)
# Basic operations
print(array + 5) # Element-wise addition
print(array * 2) # Element-wise multiplication
# Multi-dimensional arrays
matrix = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
print(matrix)
import pandas as pd
# Create a DataFrame
data = {
'Name': ['Alice', 'Bob', 'Charlie', 'David'],
'Age': [25, 30, 35, 40],
'Department': ['HR', 'IT', 'Finance', 'Marketing']
}
df = pd.DataFrame(data)
print(df)
# Basic operations
print(df.describe()) # Statistical summary
print(df['Age'].mean()) # Mean of Age column
print(df[df['Age'] > 30]) # Filter rows where Age > 30
import matplotlib.pyplot as plt
# Simple line plot
x = [1, 2, 3, 4, 5]
y = [1, 4, 9, 16, 25]
plt.plot(x, y)
plt.title('Square Numbers')
plt.xlabel('Number')
plt.ylabel('Square')
plt.show()
These slides are based on
customised version of
framework