Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pyfolio/tears.py
Original file line number Diff line number Diff line change
Expand Up @@ -1354,9 +1354,12 @@ def create_perf_attrib_tear_sheet(returns,

for factor_type, partitions in factor_partitions.items():

columns_to_select = portfolio_exposures.columns.intersection(
partitions
)

perf_attrib.plot_risk_exposures(
portfolio_exposures[portfolio_exposures.columns
.intersection(partitions)],
portfolio_exposures[columns_to_select],
ax=plt.subplot(gs[current_section]),
title='Daily {} factor exposures'.format(factor_type)
)
Expand Down
4 changes: 2 additions & 2 deletions pyfolio/tests/test_round_trips.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class RoundTripTestCase(TestCase):
],
columns=['amount', 'price', 'symbol'],
index=dates_intraday[[0, 2]])
.rename('dt', axis='index')
.rename_axis('dt', axis='index')
),
(DataFrame(data=[[2, 10., 'A'],
[2, 20., 'A'],
Expand All @@ -53,7 +53,7 @@ class RoundTripTestCase(TestCase):
],
columns=['amount', 'price', 'symbol'],
index=dates_intraday[[0, 4]])
.rename('dt', axis='index')
.rename_axis('dt', axis='index')
),
])
def test_groupby_consecutive(self, transactions, expected):
Expand Down