Is there any ifelse  statement in python similar to R? I have a pandas.core.series.Series ds of length 64843. I need to take log of each data point of this series. Some of the value in series are 0. In R I could write 
ifelse(ds==0,0,log(z))
But in python I'm not seeing similar type of statement. Can you please guide me?
 
     
     
     
    