Skip to content

Commit 03c085e

Browse files
committed
columns_to_select
1 parent c03a73c commit 03c085e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pyfolio/tears.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,9 +1354,12 @@ def create_perf_attrib_tear_sheet(returns,
13541354

13551355
for factor_type, partitions in factor_partitions.items():
13561356

1357+
columns_to_select = portfolio_exposures.columns.intersection(
1358+
partitions
1359+
)
1360+
13571361
perf_attrib.plot_risk_exposures(
1358-
portfolio_exposures[portfolio_exposures.columns
1359-
.intersection(partitions)],
1362+
portfolio_exposures[columns_to_select],
13601363
ax=plt.subplot(gs[current_section]),
13611364
title='Daily {} factor exposures'.format(factor_type)
13621365
)

0 commit comments

Comments
 (0)