Skip to content

Instantly share code, notes, and snippets.

View codistwa's full-sized avatar

Codistwa codistwa

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@codistwa
codistwa / fraud-detection.ipynb
Created December 21, 2022 16:02
Machine Learning Project : Credit Card Fraud Detection
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// ============================================================
// Definition of a variable
// ============================================================
const welcome = 'Hello';
console.log(typeof(welcome)); // string
// ============================================================
// Types
// ============================================================
@codistwa
codistwa / sets.py
Last active February 23, 2022 15:24
Course source code: https://codistwa.com/guides/sets. More courses on https://codistwa.com
# ============================================================
# Definition
# ============================================================
set([0, 1, 2, 3])
# ============================================================
# Add an item
# ============================================================
// ============================================================
// Recursion with one parameter
// ============================================================
const factorial = (num) => {
if (num === 1) {
return 1;
}
return num * factorial(num - 1);
@codistwa
codistwa / loops.c
Last active February 23, 2022 15:25
Course source code: https://codistwa.com/guides/loops. More courses on https://codistwa.com
// ============================================================
// Simple for loop
// ============================================================
int fruits [3] = {1, 2, 3};
for (int i = 0; i < 3; i++)
printf("%d\n", fruits[i] * 2);
// ============================================================
# ============================================================
# The 3 types of logarithms
# ============================================================
x = np.linspace(-3,3,100)
ln = np.log(x)
decimal = np.log10(x)
binary = np.log2(x)
# ============================================================
# What is a vector?
# ============================================================
scalar = [3] # scalar
row = np.array([2,1], dtype=object) # row matrice / vector
col = np.array([ [3], [-1] ], dtype=object) # column matrice / vector
display(Math(sym.latex(sym.sympify(scalar))))
display(Math(sym.latex(sym.sympify(row))))
# ============================================================
# Definition of fonction
# ============================================================
def area(x):
return 2 * x
print(area(4))
x = np.linspace(-6,6)
// ============================================================
// Without parameter
// ============================================================
function double () {
console.log('Hello world')
}
console.log(double()) // Hello world