File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
openbb_platform/providers/sec/openbb_sec/utils Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ async def parse_13f_hr(filing: str):
187187 data .loc [:, "putCall" ] = data ["putCall" ].fillna ("--" )
188188
189189 # Add the period ending so that the filing is identified when multiple are requested.
190- data [ "period_ending" ] = to_datetime (period_ending , yearfirst = False ).date ()
190+ data . loc [:, "period_ending" ] = to_datetime (period_ending , yearfirst = False ).date ()
191191 df = DataFrame (data )
192192 # Aggregate the data because there are multiple entries for each security and we need the totals.
193193 # We break it down by CUSIP, security type, and option type.
@@ -220,8 +220,8 @@ async def parse_13f_hr(filing: str):
220220 if col in df .columns and all (df [col ] == 0 ):
221221 df .drop (columns = col , inplace = True )
222222
223- total_value = df [ " value" ] .sum ()
224- df [ "weight" ] = round (df [ " value" ] / total_value , 6 )
223+ total_value = df . value .sum ()
224+ df . loc [:, "weight" ] = round (df . value . astype ( float ) / total_value , 6 )
225225
226226 return (
227227 df .reset_index ()
You can’t perform that action at this time.
0 commit comments