Issue resolved by @MattHaberland - the code had a separate function with the name winsorize and only 1 positional argument, hence the error message. The name of this function has since been changed and the code works.