Thanks to Kent Johnson, & David Heiser and everyone else. Looks like i
was most of the way there...hehe... David Heiser gets special bonus
points for actually understanding my initial mysterious query.
___
Tutor maillist - Tutor@python.org
http://mai
kevin parks wrote:
> hi,
>
> Seems my post added much confusion. Sorry... I was hoping not to have
> to post my code since it is really wrong and slightly embarrassing..
I think the confusion was about what input range to use. From your code
it looks like you want to use just the actual range
hi,
Seems my post added much confusion. Sorry... I was hoping not to have
to post my code since it is really wrong and slightly embarrassing..
what i am trying to do is map an input range of values to output range.
I was hoping to make it a bit of an all purpose utility that would map
pretty m
Hi Kevin,
Do you mean:?
1)take the highest value in the list hval, take the lowest value in the
list lval
2) pass top and bottom NEW values for the list: ntop nbot
3) then build another list where hval is replaced by ntop, lval is
replaced by nbot, and everything else is geometrically scaled
Is this what you're asking for?
# Scaler.py
#
def scale(OldList, NewMin, NewMax):
NewRange = float(NewMax - NewMin)
OldMin = min(x)
OldMax = max(x)
OldRange = float(OldMax - OldMin)
ScaleFactor = NewRange / OldRange
print '\nEquasion: NewValue = ((OldValue - ' + str(Old
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 w
On Tue, 14 Mar 2006, kevin parks wrote:
> is there a scaling function in python (or numeric or scipy) that can
> scale a list of values to a high precision?
>
> x = [13, 71, 120, 88, 82, 100, 10, 65, 101, 45, 26]
>
> foo = scale(x, 0, 1.0)
Hi Kevin,
I'm still confused by the problem. Let's tr