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.
// ============================================================
// Definition of an object / dictionary
// ============================================================
const fruits = {
color: 'red',
length: 3
}
// ============================================================
@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.
// ============================================================
// Comparison operators
// ============================================================
console.log(3 < 2); // false
console.log(1 == '1'); // true
console.log('Banana' === 'Banana'); // true
console.log('Banana' !== 'Apple'); // true
console.log('Banana' != 'Apple'); // true
console.log(2 <= 3); // true
-- ============================================================
-- SELECT
-- ============================================================
SELECT *
FROM humanresources.employee;
SELECT jobtitle
FROM humanresources.employee;
// ============================================================
// O(1) : constant complexity
// ============================================================
function constantO(num) {
return num;
}
console.log(constantO(10)); // 10
# ============================================================
# Definition of an array
# ============================================================
empty = []
print(empty) # []
fruits = ['apple', 'lemon']
print(fruits) # [ 'apple', 'lemon' ]
// ============================================================
// Without parameter
// ============================================================
function double () {
console.log('Hello world')
}
console.log(double()) // Hello world
# ============================================================
# Definition of fonction
# ============================================================
def area(x):
return 2 * x
print(area(4))
x = np.linspace(-6,6)
# ============================================================
# 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))))