## Python – Statistics – Regression and Classification

Regression and Classification Regression models Getting started Regression is a technique used to model and analyze the relationships between variables contribute to producing a particular outcome. More concretely, it’s a way to determine which variables have an impact, which don’t, which factors interact, and how certain we are about this. (most common techniques – linear […]

## Python – Statistics – Experiments and Significance Testing

Statistical Experiments and Significance Testing Confidence Intervals Intro to sampling Concept of sampling – a sample is a collection of data from a certain population that is meant to represent the whole. It will usually make up only a small portion of the total. The idea is that we can make conclusions about the sample […]

## Python – Statistics – Probability & Sample Distribution

Probability & Sample Distribution Conditional Probabilities You’re testing for a disease and advertising that the test is 99% accurate: if you have the disease, you will test positive 99% of the time, if you don’t have the disease, you will test negative 99% of the time. Let’s say that 1% of all people have the […]

## Python – Statistics – EDA

Exploratory Data Analysis Descriptive Statistics Working with categorical data Relationship between two variables Descriptive Statistics what it sound like  help you describe the data with numerical calculations or plots many types – focus on most common ones : measures of centrality – measures of variability Measures of centrality Mean The mean is the average, which […]

Best Practices Designing for Inheritance and Polymorphism Polymorphism   Interface # Withdraw amount from each account in list_of_accounts def batch_withdraw(list_of_accounts, amount): for acct in list_of_accounts: acct.withdraw(amount) b, c, s = BankAccount(1000), CheckingAccount(2000), SavingsAccount(3000) batch_withdraw([b,c,s]) # uses bankaccount.withdraw, checking, Savings batch_withdraw() doesn’t need to check the object to know which withdraw() to call Liskov substitution principle […]

## Python – Object Oriented Programming – Exceptions

Integration with Python Operator overloading : comparison Object equality class Customer: def __init__(self, name, balance): self.name, self.balance = name, balance cust1 = Customer(“John Fisher”, 2100) cust2 = Customer(“John Fisher”, 2100) cust1 == cust2 > False   Variables are references class Customer: def __init__(self, name, balance, id): self.name, self.balance = name, balance self.id = id cust1 […]

## Python – Object Oriented Programming – Class Inheritance

Inheritance and Polymorphism Instance and Class Data Core Principles of OOP Inheritance Extending functionality of existing code Polymorphism Creating an unified interface Encapsulation Bundling of data and Methods Instance-level data class Employee: def __init__(self, name, salary): self.name = name self.salary = salary emp1 = Employee(“Theo Mill”, 50000) emp2 = Employee(“Martina Kosova”, 65000) name , salary […]

## Python – Object Oriented Programming – Classes and Objects

Object Oriented Programming – Intro What’s OOP ? Procedural vs Object Oriented Procedural programming : sequential coding OK for Data Analysis Object Oriented Coding as interaction for object Frameworks and tools usability Terminology Object = state + behaviour  ==> a FIlou a dog has 4 legs and a tail, and can bark and fetch a […]

## Python Basics – Boolean Operations

Boolean Operations Boolean logic consists of operations done between True and False values : and ( logical conjunction) or ( logical disjunction) not ( logical negation ) Object Evaluation Evaluates as False Constants : False and None Numeric zero : 0 and 0.0 Lengths of zero : “” and [] Evaluates as True everything else […]

## Python Basics – Comparison Operators

Comparison Operators Equality :  == , != Order: < , > , <= , >= Assignment Operator Assignment : =   13 == 13 > True count = 13 print(count) > 13 Equality Comparisons datetimes numbers ( float / int ) dictionaries strings … # Comparing dictionaries d1 = {‘high’:56.78,’low’:33.24,’closing’:56.77} d2 = {‘high’:56.78,’low’:33.24,’closing’:56.77} print(d1 == […]