Skip to content

Commit a2c3221

Browse files
authored
Merge pull request #615 from huaiweicheng/master
fix_deprs: revert wrong push
2 parents c4e172e + 03c085e commit a2c3221

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
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
)

pyfolio/tests/test_round_trips.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class RoundTripTestCase(TestCase):
3939
],
4040
columns=['amount', 'price', 'symbol'],
4141
index=dates_intraday[[0, 2]])
42-
.rename('dt', axis='index')
42+
.rename_axis('dt', axis='index')
4343
),
4444
(DataFrame(data=[[2, 10., 'A'],
4545
[2, 20., 'A'],
@@ -53,7 +53,7 @@ class RoundTripTestCase(TestCase):
5353
],
5454
columns=['amount', 'price', 'symbol'],
5555
index=dates_intraday[[0, 4]])
56-
.rename('dt', axis='index')
56+
.rename_axis('dt', axis='index')
5757
),
5858
])
5959
def test_groupby_consecutive(self, transactions, expected):

0 commit comments

Comments
 (0)