Skip to content

Commit

Permalink
more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Apr 6, 2024
1 parent ac7ff75 commit 882ca2b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
22 changes: 22 additions & 0 deletions docs/api-reference/dtypes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# `narwhals.dtypes`

::: narwhals.dtypes
handler: python
options:
members:
- Int64
- Int32
- Int16
- Int8
- UInt64
- UInt32
- UInt16
- UInt8
- Float64
- Float32
- Boolean
- String
- Datetime
show_root_heading: false
show_source: false
show_bases: false
1 change: 0 additions & 1 deletion docs/api-reference/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,5 @@
- std
- str
- sum
show_root_heading: false
show_source: false
show_bases: false
14 changes: 8 additions & 6 deletions docs/why.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ print(3 in pd.Series([1, 2, 3]))
print(3 in pl.Series([1, 2, 3]))
```

Try it out and see ;)
Try it out and see ;) Spoiler alert: they don't. pandas checks if `3` is in the index,
Polars checks if it's in the values.

How about
```python
Expand All @@ -30,9 +31,10 @@ df_left.join(df_right, left_on='b', right_on='c', how='left')

?

There are several such subtle difference between the libraries. By having a unified,
simple, and predictable API, you can focus on behaviour rather than on slight implementation differences.
There are several such subtle difference between the libraries. Writing dataframe-agnostic code is hard!
But by having a unified, simple, and predictable API, you can focus on behaviour rather than on subtle
implementation differences.

Furthermore, both pandas and Polars frequently deprecate behaviour. By having a simple, predictable, and
mostly stable API, which is tested nightly against the most recent commits from both pandas and Polars,
you can develop with a lot more confidence.
Furthermore, both pandas and Polars frequently deprecate behaviour. Narwhals handles this for you by
testing against nightly builds of both libraries and handling backwards compatibility internally
(so you don't have to!).
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ nav:
- api-reference/dataframe.md
- api-reference/lazyframe.md
- api-reference/series.md
- api-reference/series_str.md
- api-reference/expressions.md
- api-reference/expressions_str.md
- api-reference/expressions_dt.md
- api-reference/dtypes.md
theme:
name: material
font: false
Expand Down

0 comments on commit 882ca2b

Please sign in to comment.