Welcome!
I think you just need to import the tensor functionality:
import pytensor.tensor as pt
and then use the mean() and std() functions:
sharpe = pt.mean(returns) / pt.std(returns) * np.sqrt(252)
Welcome!
I think you just need to import the tensor functionality:
import pytensor.tensor as pt
and then use the mean() and std() functions:
sharpe = pt.mean(returns) / pt.std(returns) * np.sqrt(252)