• The first thing you are missing is most likely within the data, my guess would be incompatible join columns. The next thing would be properly handling the bit-mask data, much more efficiently done using bitwise logic rather than an iteration. The last thing would be posting a portion of the data, including the part causing the error. Without that, we are only guessing 😉
    😎