Skip to content

Commit

Permalink
Clean up readme
Browse files Browse the repository at this point in the history
  • Loading branch information
markfairbanks committed Oct 28, 2024
1 parent 05bc520 commit 8029c93
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ df = tp.tibble(x = range(3), y = range(3, 6), z = ['a', 'a', 'b'])
.mutate(double_x = col('x') * 2,
x_plus_y = col('x') + col('y'))
)
```

```
┌─────┬─────┬─────┬──────────┬──────────┐
│ x ┆ y ┆ z ┆ double_x ┆ x_plus_y │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- │
Expand Down Expand Up @@ -69,6 +72,9 @@ Methods operate by group by calling the `by` arg.
.summarize(avg_x = tp.mean(col('x')),
_by = 'z')
)
```

```
┌─────┬───────┐
│ z ┆ avg_x │
│ --- ┆ --- │
Expand All @@ -88,6 +94,9 @@ tidyselect functions can be mixed with normal selection when selecting columns:
df = tp.tibble(x1 = range(3), x2 = range(3), y = range(3), z = range(3))

df.select(tp.starts_with('x'), 'z')
```

```
┌─────┬─────┬─────┐
│ x1 ┆ x2 ┆ z │
│ --- ┆ --- ┆ --- │
Expand All @@ -105,6 +114,9 @@ To drop columns use the `.drop()` method:

```python
df.drop(tp.starts_with('x'), 'z')
```

```
┌─────┐
│ y │
│ --- │
Expand Down

0 comments on commit 8029c93

Please sign in to comment.