File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ def get_percent_alloc(values):
3434 Positions and their allocations.
3535 """
3636 return values .divide (
37- values .abs (). sum (axis = 'columns' ),
37+ values .sum (axis = 'columns' ),
3838 axis = 'rows'
3939 )
4040
@@ -162,7 +162,7 @@ def get_sector_exposures(positions, symbol_sector_map):
162162 positions = positions .drop ('cash' , axis = 1 )
163163
164164 unmapped_pos = np .setdiff1d (positions .columns .values ,
165- symbol_sector_map .keys ())
165+ list ( symbol_sector_map .keys () ))
166166 if len (unmapped_pos ) > 0 :
167167 warn_message = """Warning: Symbols {} have no sector mapping.
168168 They will not be included in sector allocations""" .format (
Original file line number Diff line number Diff line change 1111from pandas .util .testing import (assert_frame_equal )
1212
1313from numpy import (
14- absolute ,
1514 arange ,
1615 zeros_like ,
1716)
@@ -40,7 +39,7 @@ def test_get_percent_alloc(self):
4039 result = get_percent_alloc (frame )
4140 expected_raw = zeros_like (raw_data )
4241 for idx , row in enumerate (raw_data ):
43- expected_raw [idx ] = row / absolute ( row ) .sum ()
42+ expected_raw [idx ] = row / row .sum ()
4443
4544 expected = DataFrame (
4645 expected_raw ,
You can’t perform that action at this time.
0 commit comments