Skip to content

Commit 3bccbd9

Browse files
committed
BUG: Better is_arraylike check for indicators
Avoids computing argmax on an empty sequence. Fixes #789
1 parent 1e19f85 commit 3bccbd9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backtesting/backtesting.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def init():
133133

134134
if value is not None:
135135
value = try_(lambda: np.asarray(value, order='C'), None)
136-
is_arraylike = value is not None
136+
is_arraylike = bool(value is not None and value.shape)
137137

138138
# Optionally flip the array if the user returned e.g. `df.values`
139139
if is_arraylike and np.argmax(value.shape) == 0:

0 commit comments

Comments
 (0)