Python Basics – Dictionary

Dictionaries Lists

Intro

Representation of a dictionary =  { ‘key-1’ : ‘value-1’ , ‘key-2’ : ‘value-2’ , ‘key-3’ : ‘value-3’ , ‘key-4’ : ‘value-4’  } Creation

Handling a dictionary

Accessing

Examples

   

Python Basics – Datetime

Datetimes – basic Datetime

Current Datetime

Datetime from a string

String from Datetime

  Datetimes – working with Datetime attributes

Comparing datetime

  Datetime calculation

     

Python – Machine Learnining Code Snippets

Feature Engineering Skewed Distribution You’ve been fine-tuning a machine learning model you created for predicting mortgage defaults on a mortgages DataFrame. You’re aiming to eliminate skewness from your numerical variables by using a log transformation. Despite the transformation, one of your columns is still skewed – why do you think so and what is the […]

Python – Data Visualisation Code Snippets

Bar Chart Plot a horizontal bar chart of the data contained in the df Pandas DataFrame.

Count Plot Pet owners were surveyed to determine their preference for dogs, cats or both. Visualize the response data contained in the list pets.

  Histogram Plot a histogram of the pH variable in the wine_quality […]

Python Code Snippets – Import and Cleaning

Importing and Cleaning Importing Pickle-files

CSV Files

TXT Files

MATLAB file

Excel File

  Cleaning

  Pivoting a dataframe from wide to long format

 

Python Code – Basic Programming

Lists

  Dictionaries

  Arrays numpy

  Iterators

  Lambda Function

  Functions

  Object Oriented Programming