Skip to content

Commit 4fc8ce4

Browse files
committed
BUG sampling for round trip lifetimes plot is now unique
1 parent 561112c commit 4fc8ce4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pyfolio/plotting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,7 @@ def plot_round_trip_lifetimes(round_trips, disp_amount=16, lsize=18, ax=None):
16591659
if ax is None:
16601660
ax = plt.subplot()
16611661

1662-
sample = round_trips.symbol.sample(n=disp_amount, random_state=1)
1662+
sample = round_trips.symbol.unique().sample(n=disp_amount, random_state=1)
16631663
sample_round_trips = round_trips[round_trips.symbol.isin(sample)]
16641664

16651665
symbol_idx = pd.Series(np.arange(len(sample)), index=sample)

0 commit comments

Comments
 (0)