Error in RolUp/RolDown?

Course Name: Python For Trading!, Section No: 3, Unit No: 14, Unit type: Video



When i type in this as per the video, i get an error. Appreciate the help.



df['RS'] = np.where[RolDown != 0, RolUp / RolDown, 1]

 

TypeError                                 Traceback (most recent call last)
<ipython-input-17-03844b6b7a0c> in <module>
      1 # Create variable RS and assign ratio of RolUp and RolDown to it
----> 2 df['RS'] = np.where[RolDown != 0, RolUp / RolDown, 1]
      3 df['RS_slow'] = df['RS'].rolling(window=5).mean()

TypeError: 'function' object is not subscriptable

Brackets is the issue. 

ticket closed.

I believe you got the error. 

df['RS'] = np.where[RolDown != 0, RolUp / RolDown, 1]

This should be:

df['RS'] = np.where(RolDown != 0, RolUp / RolDown, 1)