Skip to content
Home » how to » Page 6

how to

Solve Pandas “ValueError: cannot reindex from a duplicate axis”

Recently, I’ve been working with Pandas DataFrames that had a DateTime as the index. When I tried reindexing the DataFrame (using the reindex method), I bumped into an error. Let’s find out what causes it and how to solve it. The Python error I’m talking about is: A “duplicate axis”?… 

How to read ZIP files in R

In this blog post I discuss how you can load compressed CSV files, such as .zip and .tar.gz. Nowadays, many packages support it and we’ll go over the different methods. When data sets are ping-ponged across an organization, in order to limit network and storage usage, they often come in… 

How to add confidence intervals to a line in ggplot2 (R)

In this blog post, you’ll learn how to add confidence intervals to a line plot in R in the popular ggplot2 visualization package, part of the tidyverse. First, let’s create some random data to work with. For demonstrational purposes, I’ve created two time series from two normally-distributed random variables. These… 

Solve “Error parsing parameter … : Expected: ‘=’, received: ‘EOF’ for input:” in AWS CLI

The following error might occur when you would like to pass the contents of a file to an AWS CLI command. Amazon web services has very strict rules regarding referring to file contents. When you refer to the content of a file you need to use the file:// protocol. The… 

Send Optimizely Experiment and Variation to GA4 via GTM

Optimizely is an amazing product for running experiments on your digital platforms. However, their documentation is somewhat outdated. In this blog post I would like to elaborate on how to send Optimizely’s experiment ID and variation ID to Google Analytics 4 in an event parameter. Judging from the screenshots, Optimizely’s… 

VBA: fix “compile error: expected variable or procedure, not module”

I recently had to edit somebody’s VBA macro in Excel for a recurrent data cleaning task. The code was a mess because large chunks of it were created using Excel’s macro recorded. While structuring the code in subroutines and modules, I ran into an error. In this blog post I…