[Tutor] scaling values
Bob Gailer
bgailer at alum.rpi.edu
Tue Mar 14 16:32:25 CET 2006
kevin parks wrote:
> i have various functions (that i didn't write) that put out data in
> lists of various types. But some functions (which i didn't write) that
> expect the data to be scaled, sometimes 0-1 sometimes 1-2, sometimes
> 0-127..., sometimes 0 - 32768... gosh you name it. In other words i
> have a bunch of black boxes that don't speak the same language .... is
> there a scaling function in python (or numeric or scipy) that can scale
> a list of values to a high precision?
>
Perhaps someone on this list knows what you want, but I don't. What is
"scaling"? What does foo look like?
> x = [13, 71, 120, 88, 82, 100, 10, 65, 101, 45, 26]
>
> foo = scale(x, 0, 1.0)
>
> and get that list scaled 0 to 1, or if i had:
>
> x = [.12789, .982779, .19798198, .266796, .656527, .257877091]
>
> foo = scale(x, 0, 127)
>
>
More information about the Tutor
mailing list