Home
noisrucer
Cancel

OOP: Inheritance

Inheritance Inheritance is the virtue of Object Oriented Programming. Python, of course, has one. When you want to inherit a parent class, you put that parent class name in the parentheses of chi...

OOP: Class

Class Class ia a blueprint for creating an instance. Creating a new class creates a new type of object with which new instances of that type are made. Class can hold attributes describing sta...

Namespace and Scope

Namespace We’ve been hearing about the word namespace all the time. But what the heck is it really?? A namespace is a mapping from names to objects. In python, namespaces are internally implem...

Batch Normalization

Deep Neural Networks might face a variety of problems, for example, gradient vanishing/exploding. As the network gets deeper and deeper, it becomes harder to train on. Bad initializations such as ...

Python Variables

Variable Name alphabet, number no reserved-keywords Primitive data types Dynamic Typing: declare data type during execution # int x1 = 1 # float x2 = 3.3 # string x3 = 'ab...

File / Exception / Logging

Exception class DivisionBySevenError(Exception): def __init__(self, msg): self.msg = msg def __str__(self): return self.msg class DivisionByOneError(Exception): def _...

Pythonic Code

split, join list comprehension enumerate, zip lambda, map, reduce generator asterisk split items = "jason.marry.jonathan.joseph".spli...

Data Structures

Stack stk = [] stk.append(0) stk.append(1) stk.append(2) print(stk) stk.pop() print(stk) [0, 1, 2] [0, 1] Queue q = [] q.append(1) q.append(2) q.append(3) print(q) q.pop(0) print(q) [1, 2...

Strings / Advanced Functions

String store char data in sequence char: 1byte 1byte = 8bit = 256 converts bit to char or vice-versa according to rules (UTF-8, ASCII, etc) int = 4b...

Conditionals and Loops

Compare Operators x == y: value x is y: value and memory a = [1, 2, 3, 4, 5] b = [1, 2, 3, 4, 5] print(a == b) print(a is b) True False [Important] There’s reserved memory space -5 ~ 256 (s...

Trending Tags