Skip to content

Updated documentation for pandas.DataFrame.map #54649

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

Closed
wants to merge 7 commits into from
Closed

Updated documentation for pandas.DataFrame.map #54649

wants to merge 7 commits into from

Conversation

DarthKitten2130
Copy link
Contributor

closes issue #54648 by adding another example of the map method using a standard func, along with additional keyword arguments.

Added an example for standard functions for the map function
Added documentation for extra keyword arguments in the map method
@@ -10088,6 +10088,20 @@ def map(
0 3 4
1 5 5

>>> def func(x,y): # x refers to the element in the DataFrame
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you just define a lambda that takes an extra argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually my goal was to demonstrate how the map function can be used with standard functions that are not lambdas. If you think I should use a more complex example to show that, I could do so.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you just provide a built in function like round?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the advice! I did just that, you can have a look.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Looks like some code checks are failing in the CI

@mroeschke mroeschke added the Docs label Aug 25, 2023
@DarthKitten2130 DarthKitten2130 marked this pull request as draft August 30, 2023 16:49
@DarthKitten2130 DarthKitten2130 marked this pull request as ready for review August 30, 2023 16:56
@mroeschke
Copy link
Member

Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.

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

Successfully merging this pull request may close these issues.

2 participants