Skip to content

Commit 2d4c312

Browse files
mmckyHumphreyYang
andauthored
Update lectures/polars.md
Co-authored-by: Humphrey Yang <[email protected]>
1 parent c923a65 commit 2d4c312

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lectures/polars.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,8 @@ for index_col in indices_data.columns:
781781
pl.col(index_col).last().alias('last_price')
782782
])
783783
.with_columns(
784-
((pl.col('last_price') - pl.col('first_price') + 1e-10) / (pl.col('first_price') + 1e-10)).alias('return')
784+
((pl.col('last_price') - pl.col('first_price') + 1e-10)
785+
/ (pl.col('first_price') + 1e-10)).alias('return')
785786
)
786787
.with_columns(pl.lit(indices_list[index_col]).alias('index_name'))
787788
.select(['year', 'index_name', 'return']))

0 commit comments

Comments
 (0)