Piecewise functions.
22 Sep
2005
22 Sep
'05
8:47 a.m.
Hi all, this is probably an already discussed problem, but I've not been able to find a solution even after googling a lot. I've a piecewise defined function: / | f1(x) if x <= a f(x) = | | f2(x) if x > a \ where f1 and f2 are not defined outside the above range. How can I define such a function in Python in order to apply (map) it to an array ranging from values smaller to values bigger than a? Thanks, Andrea.
6778
Age (days ago)
6783
Last active (days ago)
11 comments
6 participants
participants (6)
-
Alan G Isaac
-
Andrea Riciputi
-
Gerard Vermeulen
-
Greg Ewing
-
Paulo J. S. Silva
-
Travis Oliphant