-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: add more examples to StringMethods on Index #9858
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
Conversation
index=range(3)) | ||
df | ||
|
||
Since the column of a DataFrame is an Index object, we can use the .str accessor |
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.
maybe "column names" instead of "columns"?
@shoyer good idea, it's updated |
index=range(3)) | ||
df | ||
|
||
Since ``df.columns`` is an Index object, we can use the .str accessor |
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.
quote .str with two backticks?
@@ -37,6 +37,32 @@ the equivalent (scalar) built-in string methods: | |||
idx.str.lstrip() | |||
idx.str.rstrip() | |||
|
|||
The string methods on Index are especially useful for cleaning up or | |||
transforming DataFrame columns. For instance, you may have columns with | |||
leading or trailing whitespaces: |
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.
Just "whitespace", I think
This looks great to me! I'll just hold off on merging until Joris can take a look. |
Looks good, thanks a lot! |
DOC: add more examples to StringMethods on Index
as discussed in #9667
@jorisvandenbossche please take a look, thanks