Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC Maybe have other ways than narwhalify in the tutorial? #1372

Open
adrinjalali opened this issue Nov 13, 2024 · 3 comments
Open

DOC Maybe have other ways than narwhalify in the tutorial? #1372

adrinjalali opened this issue Nov 13, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@adrinjalali
Copy link

This is my first actual reading of the docs with a usecase where I'd use narwhals. Going through the README, I was told to check a tutorial:

narwhals/README.md

Lines 95 to 98 in 4c2b60e

## Example
See the [tutorial](https://narwhals-dev.github.io/narwhals/basics/dataframe/) for several examples!

But the tutorial only has this kind of pattern AFAICT:

@nw.narwhalify
def func(df: FrameT) -> FrameT:
    return df.select(
        a_sum=nw.col("a").sum(),
        a_mean=nw.col("a").mean(),
        a_std=nw.col("a").std(),
    )

while I wold have expected to also been shown examples of non-decorator ways of doing things, which I think is from_native.

@MarcoGorelli
Copy link
Member

Hey @adrinjalali , thanks for the suggestion

I was thinking about this recently #386 (comment) and am tempted to say we should just use from_native / to_native everywhere by default. Looking around at real-world usage of Narwhals, that's indeed how most people are interacting with the library

@MarcoGorelli MarcoGorelli added the documentation Improvements or additions to documentation label Nov 13, 2024
@adrinjalali
Copy link
Author

@marenwestermann wanna have a look maybe? 😁

@marenwestermann
Copy link
Contributor

It's good to get some feedback on this. Given that many people seem to find it easier to use from_native and to_native I guess it's better to go back to that as a default. Updating the documentation accordingly could be another meta-issue for the planned sprint or would you prefer to do this earlier @MarcoGorelli ? If we want to use this for the sprint I can make an issue with a list of functions/ methods that would need the update.
PS: I still love the narwhalify decorator! I had a good laugh when I first came across it. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants