Open MarcoGorelli opened 1 month ago
I can take a stab at making a PR for one of the functions (DataFrame to_pandas() )
I will try the DataFrame.to_csv()
I worked on Expr.mean
in expr.py
. If this looks good I could do the others in Expr
.
PR: #1207
Glad that the doc update for Expr.mean
went smooth. Can now also pick up the other functions in Expr
.
In the docstrings example in https://narwhals-dev.github.io/narwhals/api-reference/dataframe/, we always show the output for pandas and Polars
We should instead:
- show pandas, Polars (eager), and Pyarrow
- phrases such as "We can then pass either pandas or Polars:" should be rephrased to "We can then pass any supported library such as pandas, Polars, or PyArrow:"
This is very much personal taste, but what would you think about rendering the different outputs via mkdocs-material
content tabs? Something like the following
=== "pandas"
```python
func(df_pd)
```
Output:
```
a b
0 24.5 74.5
```
=== "Polars (eager)"
```python
func(df_pl)
```
Output:
```
shape: (1, 2)
┌──────┬──────┐
│ a ┆ b │
│ --- ┆ --- │
│ f64 ┆ f64 │
╞══════╪══════╡
│ 24.5 ┆ 74.5 │
└──────┴──────┘
```
=== "PyArrow"
```python
func(df_pa)
```
Output:
```
pyarrow.Table
a: double
b: double
----
a: [[24.5]]
b: [[74.5]]
```
This is very much personal taste, but what would you think about rendering the different outputs via
mkdocs-material
content tabs? Something like the following
@AlessandroMiola I like the tabbed output much more as well, but I think the issue was compatibility with doctest. If you manage to figure out how to have both, I am absolutely happy to move to such output rendering
This is very much personal taste, but what would you think about rendering the different outputs via
mkdocs-material
content tabs? Something like the following@AlessandroMiola I like the tabbed output much more as well, but I think the issue was compatibility with doctest. If you manage to figure out how to have both, I am absolutely happy to move to such output rendering
Ahh, right! I see, thanks @FBruzzesi
In the docstrings example in https://narwhals-dev.github.io/narwhals/api-reference/dataframe/, we always show the output for pandas and Polars
We should instead:
If this is your first time submitting a pull request, please choose one function to start with, and only submit a pull request for that one function. You've got used to the process, feel free to submit changes for more functions together (e.g. in groups of 3-4 functions in the same PR)
Contributing guide: https://github.com/narwhals-dev/narwhals/blob/main/CONTRIBUTING.md
example PR: https://github.com/narwhals-dev/narwhals/pull/1010