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


Excel File


  Pivoting a dataframe from wide to long format


Python Code – Basic Programming



  Arrays numpy


  Lambda Function


  Object Oriented Programming