Not sure I understand what the slice(0, -1) is trying to achieve. I've definitely never seen it before.