A complete beginner-friendly documentation project with runnable examples in NumPy, Pandas, Scikit-learn, Matplotlib and JavaScript equivalents.
Use this as your README.md for GitHub.
This project contains easy-to-understand documentation and runnable examples for:
- NumPy (Array operations, math, reshaping)
- Pandas (DataFrames, CSV, cleaning)
- Scikit-learn (Regression, Classification, Training/Testing)
- Matplotlib (Basic plots)
- JavaScript Equivalents: math.js & TensorFlow.js
Perfect for beginners building a portfolio.
π data-science-docs-examples
β
βββ README.md
βββ examples/
β βββ numpy_basics.py
β βββ pandas_basics.py
β βββ sklearn_regression.py
β βββ matplotlib_plot.py
β
βββ js/
β βββ mathjs_example.js
β βββ tfjs_regression.js
β
βββ datasets/
βββ sample.csv
NumPy is a Python library used for fast numerical computing.
import numpy as np
arr = np.array([1, 2, 3])
print(arr)a = np.array([1, 2, 3])
b = np.array([4, 5, 6])
print(a + b)
print(a * b)Pandas is used for working with structured data.
import pandas as pd
data = {"Name": ["A","B","C"], "Age": [20,25,30]}
df = pd.DataFrame(data)
print(df)df = pd.read_csv("datasets/sample.csv")
print(df.head())from sklearn.linear_model import LinearRegression
import numpy as np
X = np.array([[1],[2],[3],[4]])
y = np.array([2, 4, 6, 8])
model = LinearRegression()
model.fit(X, y)
print(model.predict([[5]]))from sklearn.model_selection import train_test_split
import numpy as np
X = np.array([[1],[2],[3],[4],[5],[6]])
y = np.array([3,6,9,12,15,18])
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
print("Train: ", X_train)
print("Test: ", X_test)import matplotlib.pyplot as plt
x = [1,2,3,4]
y = [2,4,6,8]
plt.plot(x, y)
plt.xlabel("X values")
plt.ylabel("Y values")
plt.title("Simple Plot")
plt.show()const math = require('mathjs');
let a = math.matrix([1,2,3]);
let b = math.matrix([4,5,6]);
console.log(math.add(a,b));import * as tf from '@tensorflow/tfjs';
const model = tf.sequential();
model.add(tf.layers.dense({units: 1, inputShape: [1]}));
model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});
const xs = tf.tensor2d([1,2,3,4], [4,1]);
const ys = tf.tensor2d([2,4,6,8], [4,1]);
model.fit(xs, ys).then(() => {
model.predict(tf.tensor2d([5], [1,1])).print();
});Name,Age,Score
A,20,85
B,22,90
C,25,88
python examples/numpy_basics.py
python examples/pandas_basics.py
python examples/sklearn_regression.py
node js/mathjs_example.js
node js/tfjs_regression.js
"create full code files".
Install dependencies using:
pip install -r requirements.txtRun the examples:
python examples/pandas_basics.py
python examples/numpy_basics.py
python examples/matplotlib_basics.py
python examples/sklearn_basics.py- Ensure Python 3.7+ is installed
- Install all dependencies from requirements.txt