-
Notifications
You must be signed in to change notification settings - Fork 119
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
Add docstrings #32
Add docstrings #32
Conversation
- Use correct indentation for YAML file
- Add more docstrings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These docstrings are great, thank you so much @frnmst !
Looks like CI is failing with
E ValueError: line 29 of the doctest for narwhals.dataframe.DataFrame.group_by has an invalid option: '+IGNORE_RESULT'
Just got some minor comments
narwhals/dataframe.py
Outdated
n: Number of rows to return. If a negative value is passed, return all rows | ||
except the last `abs(n)`. | ||
|
||
See Also: `tail`, `glimpse`, `slice` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't this we have these yet, shall we remove this?
narwhals/dataframe.py
Outdated
|
||
Arguments: | ||
*columns: Names of the columns that should be removed from the dataframe. | ||
Accepts column selector input. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't yet have column selectors in Narwhals, let's remove this for now
narwhals/dataframe.py
Outdated
Drop multiple columns by passing a selector. | ||
|
||
>>> import polars.selectors as cs | ||
>>> dframe = df.drop(cs.numeric()) | ||
>>> dframe | ||
┌─────────────────────────────────────────────────┐ | ||
| Narwhals DataFrame | | ||
| Use `narwhals.to_native()` to see native output | | ||
└─────────────────────────────────────────────────┘ | ||
>>> nw.to_native(dframe) | ||
shape: (3, 1) | ||
┌─────┐ | ||
│ ham │ | ||
│ --- │ | ||
│ str │ | ||
╞═════╡ | ||
│ a │ | ||
│ b │ | ||
│ c │ | ||
└─────┘ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove this one
I think I fixed everything |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @frnmst ! Seriously good docstrings here, well done!
Little tip - I'd suggest making a new branch for each new PR (rather than opening PRs from main
), it just makes it a bit easier to review
Also, I removed some |
Ok, will do
Ok, I'll keep that in mind for the next docstrings |
narwhals.dataframe.DataFrame
class