cvxportfolio icon indicating copy to clipboard operation
cvxportfolio copied to clipboard

Value error

Open heshriti opened this issue 5 years ago • 2 comments

Hi,

I've installed the packages pip. That's the only way I could get this package installed. Can this package be updated with working examples please.

In the Singleperiod example,

simulated_tcost = cp.TcostModel(half_spread=0.0005/2., nonlin_coeff=1., sigma=sigmas, volume=volumes)

I get a ValueError as follows: ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

heshriti avatar Apr 13 '19 21:04 heshriti

Please provide the whole stack trace, not just the error message.

joseortiz3 avatar Apr 13 '19 21:04 joseortiz3

Traceback (most recent call last): File "SinglePeriodOptimization.py", line 34, in simulated_tcost = cp.TcostModel(half_spread=0.0005/2., nonlin_coeff=1., sigma=sigmas, volume=volumes) File "/usr/home/cvxportfolio/costs.py", line 143, in init null_checker(sigma) File "/usr/home/cvxportfolio/utils/data_management.py", line 29, in null_checker if np.any(pd.isnull(obj)): File "/usr/local/lib/python2.7/site-packages/pandas/core/generic.py", line 1121, in nonzero .format(self.class.name)) ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

heshriti avatar Apr 14 '19 15:04 heshriti