TypeError: integer argument expected, got float in encode_scaled, / should be // to get interger result from a division