Skip to content

Commit

Permalink
Merge pull request #283 from markfairbanks/docs-cleanup
Browse files Browse the repository at this point in the history
Correct functions in examples
  • Loading branch information
markfairbanks authored Nov 2, 2024
2 parents 0b4a5a6 + 3e58113 commit e3c5e1a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tidypolars/funs.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def cast(x, dtype):
Examples
--------
>>> df.mutate(abs_x = tp.cast(col('x'), tp.Float64))
>>> df.mutate(float_x = tp.cast(col('x'), tp.Float64))
"""
x = _col_expr(x)
return x.cast(dtype)
Expand All @@ -230,7 +230,7 @@ def coalesce(*args):
Examples
--------
>>> df.mutate(abs_x = tp.cast(col('x'), tp.Float64))
>>> df.mutate(coalesce_xy = tp.coalesce(col('x'), col('y')))
"""
args = _as_list(args)
expr = if_else(args[0].is_null(), args[1], args[0])
Expand Down Expand Up @@ -274,7 +274,7 @@ def cov(x, y):
Examples
--------
>>> df.summarize(cor = tp.cov(col('x'), col('y')))
>>> df.summarize(cov = tp.cov(col('x'), col('y')))
"""
return pl.cov(x, y)

Expand Down Expand Up @@ -412,7 +412,7 @@ def is_not(x):
Examples
--------
>>> df = tp.tibble(x = range(3))
>>> df.filter(tp.not_(col('x') < 2))
>>> df.filter(tp.is_not(col('x') < 2))
"""
x = _col_expr(x)
return x.not_()
Expand Down Expand Up @@ -465,7 +465,7 @@ def is_not_null(x):
Examples
--------
>>> df = tp.tibble(x = range(3))
>>> df.filter(tp.is_not_in(col('x'), [1, 2]))
>>> df.filter(tp.is_not_null(col('x'), [1, 2]))
"""
x = _col_expr(x)
return x.is_null().not_()
Expand All @@ -482,7 +482,7 @@ def is_null(x):
Examples
--------
>>> df = tp.tibble(x = range(3))
>>> df.filter(tp.is_not_in(col('x'), [1, 2]))
>>> df.filter(tp.is_null(col('x')))
"""
x = _col_expr(x)
return x.is_null()
Expand Down

0 comments on commit e3c5e1a

Please sign in to comment.