Skip to content

Commit 61d8f9e

Browse files
committed
BUG Cone SDs should be floats
In pandas=0.16.2, despite setting pd.DataFrame(columns=pd.Float64Index([])), pandas will convert the column index to int64 when an int is used for the column and all subsequent assignments will be cast to int resulting in the error: ValueError: cannot insert 1.5, already exists
1 parent f5f88f0 commit 61d8f9e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pyfolio/tests/test_timeseries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def test_bootstrap_cone_against_linear_cone_normal_returns(self):
369369
random_seed = 100
370370
np.random.seed(random_seed)
371371
days_forward = 200
372-
cone_stdevs = [1, 1.5, 2]
372+
cone_stdevs = (1., 1.5, 2.)
373373
mu = .005
374374
sigma = .002
375375
rets = pd.Series(np.random.normal(mu, sigma, 10000))

pyfolio/timeseries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ def rolling_sharpe(returns, rolling_sharpe_window):
964964
* np.sqrt(APPROX_BDAYS_PER_YEAR)
965965

966966

967-
def forecast_cone_bootstrap(is_returns, num_days, cone_std=[1, 1.5, 2],
967+
def forecast_cone_bootstrap(is_returns, num_days, cone_std=(1., 1.5, 2.),
968968
starting_value=1, num_samples=1000,
969969
random_seed=None):
970970
"""

0 commit comments

Comments
 (0)