-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fix incorrect example in wide_to_long docstring #25736
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
Closed
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d472c17
Fix incorrect example in wide_to_long docstring
5bda59c
Merge branch 'master' into update-docs
bharatr21 26a28d5
More changes to docstring, added CI, removed whatsnew courtesy @TomAu…
cda32f0
Fixed ellipsis, added back whatsnew
aebff33
Final doctest fix
87a0867
Final doctest fix
e7b1679
Final doctest fix
b182905
Merge remote-tracking branch 'upstream/master' into update-docs
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -333,14 +333,11 @@ def wide_to_long(df, stubnames, i, j, sep="", suffix=r'\d+'): | |
... 'X' : np.random.randint(3, size=3)}) | ||
>>> df['id'] = df.index | ||
>>> df # doctest: +NORMALIZE_WHITESPACE, +ELLIPSIS | ||
A(quarterly)-2010 A(quarterly)-2011 B(quarterly)-2010 ... | ||
0 0.548814 0.544883 0.437587 ... | ||
1 0.715189 0.423655 0.891773 ... | ||
2 0.602763 0.645894 0.963663 ... | ||
X id | ||
0 0 0 | ||
1 1 1 | ||
2 1 2 | ||
A(quarterly)-2010 A(quarterly)-2011 B(quarterly)-2010 ... X id | ||
0 0.548814 0.544883 0.437587 ... 0 0 | ||
1 0.715189 0.423655 0.891773 ... 1 1 | ||
2 0.602763 0.645894 0.963663 ... 2 2 | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can delete this line I think. |
||
|
||
>>> pd.wide_to_long(df, ['A(quarterly)', 'B(quarterly)'], i='id', | ||
... j='year', sep='-') | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is the output too wide to include all the columns without any ellipses?
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.
Yes @TomAugspurger the line is too wide to include all columns, so deleted only "B(quarterly)-2011" column (88 > 79 chars on
pycodestyle
andflake8
)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.
Hrm, that's a little unfortunate as all the columns are important :/
Well, for now, let's use ellipses. FYI, your spacing is just slightly off, so it failed again :)
I think you need an extra space so that the values in
id
are under thed
.