Skip to content

Commit

Permalink
docs: change filter to filter_ in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
pwwang authored Dec 29, 2023
1 parent d2e4a41 commit 6220dbb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ pip install -U datar[pandas]
```python
# with pandas backend
from datar import f
from datar.dplyr import mutate, filter, if_else
from datar.dplyr import mutate, filter_, if_else
from datar.tibble import tibble
# or
# from datar.all import f, mutate, filter, if_else, tibble
# from datar.all import f, mutate, filter_, if_else, tibble

df = tibble(
x=range(4), # or c[:4] (from datar.base import c)
Expand All @@ -68,15 +68,15 @@ df >> mutate(z=if_else(f.x>1, 1, 0))
3 3 three 1
"""

df >> filter(f.x>1)
df >> filter_(f.x>1)
"""# output:
x y
<int64> <object>
0 2 two
1 3 three
"""

df >> mutate(z=if_else(f.x>1, 1, 0)) >> filter(f.z==1)
df >> mutate(z=if_else(f.x>1, 1, 0)) >> filter_(f.z==1)
"""# output:
x y z
<int64> <object> <int64>
Expand Down

0 comments on commit 6220dbb

Please sign in to comment.