How to create a QR code using Python

The QR code, or Quick Response Code, works by encoding data in a two-dimensional barcode. It is a type of matrix barcode, which is a two-dimensional barcode that uses a...

How to use Optuna for XGBoost hyperparameter tuning

Over the past year or so, the Optuna package has quickly become a favourite among data scientists for hyperparameter tuning on machine learning models, and for good reason. It’s lightweight,...

How to use NLTK for POS tagging in Pandas

The Natural Language Toolkit (NLTK) is a powerful Python package for performing a wide range of common NLP tasks, including Part of Speech tagging or POS tagging for short.

How to create GitLab issues using the Python GitLab API

GitLab is one of the most widely used project management tools in software development and data science. It’s similar to Jira and similar systems in that it provides a useful...

How to transform numeric Pandas dataframe column values

When working with Pandas dataframes you’ll often need to convert values from one format to another. For example, you might need to convert a string to a float or an...

How to calculate the difference and percentage change between rows in Pandas

When working with Pandas dataframes, it’s a very common task to calculate the difference between two rows. For example, you might want to calculate the difference in the number of...

How to calculate Customer Lifetime Value heuristics

Customer Lifetime Value or CLV (also erroneously called Lifetime Customer Value or Lifetime Value) is one of the most misunderstood of all marketing metrics. Weirdly, everyone in marketing understands its...

How to create a fake review detection model

Fake reviews seem to be everywhere these days, leaving customers unsure over which products or businesses are actually any good. Whether you’re shopping on Amazon, checking out a restaurant on...

How to use isna() to check for missing values in a Pandas dataframe

Real world data is rarely clean, and you’ll often encounter missing values when working with Pandas dataframes. Missing values can lead to errors in your code, and can cause models...