title: Pandas Step function with rank
body: <p>I am trying to rank a column with the following function:</p>
  <p><code>f(x) = if x=0, then y=0 else if x&lt;0 then y=0.5 else y=rank(x) </code>
  Any ideas on how can I achieve this?</p>