title: error in coding probability weighting function
body: <p>I have a question regarding my code (sorry if it is really easy or stupid, I have never coded before and tried this for a project). I tried running a probability weighting function for certain probability vector. I however get an error and I do not know how to fix it. When i run the argument of the function first seperatly and then call it in the function it works, but why does it not work in the function itself?
  Code Below</p>
  <p>I hope you can help me.
  Thanks a lot!</p>
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  
  p = np.arange(0.01, 1, 0.01) # probalities equaly spread between 0 &amp; 1 in steps of 0.01 
  
  alpha_1 = 0.5
  alpha = np.zeros((1, 99)) + alpha_1 # vector of same length as p with all entries being 0.5
  
  term_in_exopnential_of_weighting_function = - (- np.log(p))**alpha
  w = np.exp(term_in_exopnential_of_weighting_function) # weighted probability function 
  
  # probability weighting function
  #w(p)=np.exp(-(- np.log(p))**alpha) 
      # --&gt; error, but why?`
  </code></pre>