Python Cheat Sheet (NumPy, pandas, scikit-learn)
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
Read More :- https://silentbulk.weebly.com/blog/how-to-make-peanut-butter-easy-step-by-step-recipe-homemade-peanut-butter-recipe
NumPy Quick Reference
arr = np.array([1, 2, 3, 4])
mean = np.mean(arr) # Mean of array
pandas Quick Reference
data = {'Name': ['Alice', 'Bob'], 'Age': [25, 30]}
df = pd.DataFrame(data)
df.head() # View first few rows
scikit-learn Quick Reference
X = df[['Age']]
y = df['Name']
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
R Programming Cheat Sheet
R provides similar functionality for data manipulation and visualization
Example:
df <- data.frame(Name=c("Alice", "Bob"), Age=c(25, 30))
summary(df)
SQL Cheat Sheet (Basic Query Examples)
Basic SQL query structure
SELECT Name, Age FROM users WHERE Age > 25;
Machine Learning Cheat Sheet (Model Training Example)
from sklearn.ensemble import RandomForestClassifier
model = RandomForestClassifier()
model.fit(X_train, y_train)
Deep Learning Cheat Sheet (Using TensorFlow/Keras)
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
model = Sequential([
Dense(64, activation='relu', input_dim=8),
Dense(1, activation='sigmoid')
])
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
Statistics Cheat Sheet (Common Formulas)
import scipy.stats as stats
mean = np.mean(arr) # Mean calculation
std_dev = np.std(arr) # Standard deviation
p_value = stats.ttest_1samp(arr, 0) # One-sample t-test
Data Visualization Cheat Sheet (Matplotlib & Seaborn)
import matplotlib.pyplot as plt
import seaborn as sns
Simple plot using Matplotlib
plt.plot([1, 2, 3], [4, 5, 6])
plt.show()
Simple plot using Seaborn
sns.boxplot(x=df['Age'])
plt.show()