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

docs: add docstring examples for dtypes #1077

Open
MarcoGorelli opened this issue Sep 27, 2024 · 4 comments
Open

docs: add docstring examples for dtypes #1077

MarcoGorelli opened this issue Sep 27, 2024 · 4 comments
Labels
documentation Improvements or additions to documentation Medium priority

Comments

@MarcoGorelli
Copy link
Member

The dtypes don't currently have docstrings https://narwhals-dev.github.io/narwhals/api-reference/dtypes/

it would be good to add a docstring to each, perhaps even with an example of how to end up with that dtype pandas/polars/pyarrow

@anopsy
Copy link
Member

anopsy commented Sep 27, 2024

I'll take that.
Just found out that Polars documentation doesn't show examples for dtypes. And Pandas documentation has examples that look like:

>>>pd.BooleanDtype()
BooleanDtype

@anopsy
Copy link
Member

anopsy commented Sep 27, 2024

hey @MarcoGorelli, I'd like to clarify what do you mean by "example how to end up with that dtype", do you mean - first using cast and then checking the series dtype, or just checking the dtype of series or a third secret thing?
Btw do we want to implement Dataframe.dtypes ?

@MarcoGorelli
Copy link
Member Author

i think any operation which produces that dtype is probably fine...e..g for boolean: nw.from_native(pd.Series([True, True, False]), series_only=True).dtype produces nw.Boolean

Dataframe.dtypes

not sure, there's already DataFrame.schema

@anopsy
Copy link
Member

anopsy commented Sep 28, 2024

Thank you, that helps a lot!

@MarcoGorelli MarcoGorelli added documentation Improvements or additions to documentation Medium priority labels Oct 15, 2024
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 Medium priority
Projects
None yet
Development

No branches or pull requests

2 participants