Skip to content

Commit

Permalink
docs: fix rendering (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli authored Jun 29, 2024
1 parent e1ee2e4 commit 24dd191
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
3 changes: 1 addition & 2 deletions docs/basics/complete_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ import narwhals as nw

class StandardScaler:
@nw.narwhalify(eager_only=True)
def fit(self, df_any):
df = nw.from_native(df_any, eager_only=True)
def fit(self, df):
self._means = {col: df[col].mean() for col in df.columns}
self._std_devs = {col: df[col].std() for col in df.columns}

Expand Down
8 changes: 2 additions & 6 deletions narwhals/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,9 +615,7 @@ def diff(self) -> Expr:
the diff and fill missing values with `0` in a Int64 column, you could
do:
```python
nw.col("a").diff().fill_null(0).cast(nw.Int64)
```
nw.col("a").diff().fill_null(0).cast(nw.Int64)
Examples:
>>> import polars as pl
Expand Down Expand Up @@ -668,9 +666,7 @@ def shift(self, n: int) -> Expr:
and fill missing values with `0` in a Int64 column, you could
do:
```python
nw.col("a").shift(1).fill_null(0).cast(nw.Int64)
```
nw.col("a").shift(1).fill_null(0).cast(nw.Int64)
Examples:
>>> import polars as pl
Expand Down
8 changes: 2 additions & 6 deletions narwhals/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,7 @@ def diff(self) -> Self:
the diff and fill missing values with `0` in a Int64 column, you could
do:
```python
s_any.diff().fill_null(0).cast(nw.Int64)
```
s_any.diff().fill_null(0).cast(nw.Int64)
Examples:
>>> import pandas as pd
Expand Down Expand Up @@ -742,9 +740,7 @@ def shift(self, n: int) -> Self:
and fill missing values with `0` in a Int64 column, you could
do:
```python
s_any.shift(1).fill_null(0).cast(nw.Int64)
```
s_any.shift(1).fill_null(0).cast(nw.Int64)
Examples:
>>> import pandas as pd
Expand Down

0 comments on commit 24dd191

Please sign in to comment.