-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: doc/source/whatsnew #36857
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
DOC: doc/source/whatsnew #36857
Conversation
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.
Nice!
@@ -354,15 +362,15 @@ Some East Asian countries use Unicode characters its width is corresponding to 2 | |||
|
|||
.. ipython:: python | |||
|
|||
df = pd.DataFrame({u'国籍': ['UK', u'日本'], u'名前': ['Alice', u'しのぶ']}) | |||
df; |
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.
@dsaxton I guess the semi-colon should stay here? Might be a case of manually changing something that was changed by blacken-docs
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 think so, it looks like it's being added to suppress output (there are some other cases where this is done to prevent matplotlib from printing text to the screen)
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.
Should I add the semi-colon then? I'll let you know if I find any more like this too. @MarcoGorelli @dsaxton
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, please do
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.
done!
Co-authored-by: Marco Gorelli <[email protected]>
Co-authored-by: Marco Gorelli <[email protected]>
doc/source/whatsnew/v0.10.0.rst
Outdated
data = ('a,b,c\n' | ||
'1,Yes,2\n' | ||
'3,No,4') | ||
data = "a,b,c\n1,Yes,2\n3,No,4" |
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.
@jorisvandenbossche made the valid point that this is slightly harder to understand as an input to read_csv, so maybe we use a multiline string similar to this instead (which black is fine with):
data = """
a,b,c
1,Yes,2
3,No,4
"""
What do you think @meghana-12 @MarcoGorelli ?
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'll be making changes in a min then.
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.
This same pattern appears in several places within doc/source/user_guide/io.rst, so if you wanted to tackle those in another PR that would also be very welcome
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.
Sure, I'll have a look at it! Are there any tools that'll help me with the issue or they need to be edited manually @dsaxton ?
doc/source/whatsnew/v0.9.0.rst
Outdated
data = ('0,0,1\n' | ||
'1,1,0\n' | ||
'0,1,0') | ||
data = "0,0,1\n1,1,0\n0,1,0" |
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.
Same comment as above from doc/source/whatsnew/v0.10.0.rst (can this be written on multiple lines using """
)? After this I think this'll be good to go
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.
okay, I'll make the changes asap.
doc/source/whatsnew/v0.17.0.rst
Outdated
pd.set_option('display.unicode.east_asian_width', True) | ||
df; | ||
pd.set_option("display.unicode.east_asian_width", True) | ||
df |
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 semi-colon need to be added here? @dsaxton @MarcoGorelli
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.
Yeah I think we want one here too
doc/source/whatsnew/v0.19.0.rst
Outdated
@@ -235,17 +246,17 @@ converting to ``Categorical`` after parsing. See the io :ref:`docs here <io.cat | |||
|
|||
.. ipython:: python | |||
|
|||
data = 'col1,col2,col3\na,b,1\na,b,2\nc,d,3' | |||
data = "col1,col2,col3\na,b,1\na,b,2\nc,d,3" |
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 believe this can be converted into multiline too? @dsaxton @MarcoGorelli
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, I think that would be good
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.
Sure. There's also a similar line in doc/source/whatsnew/v0.19.0.rst .
Just a generic comment - it doesn't seem to make a difference in these examples, but in general you'll probably want to remove the leading and trailing newlines by ending the first and last lines with \
:
In [7]: data = """
...: a,b,c
...: 1,Yes,2
...: """
In [8]: data
Out[8]: '\na,b,c\n1,Yes,2\n'
In [9]: data = """\
...: a,b,c
...: 1,Yes,2\
...: """
In [10]: data
Out[10]: 'a,b,c\n1,Yes,2'
See how the second example (starting with """\
matches the string 'a,b,c\n1,Yes,2'
while the first one has extra newlines)
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.
In these examples the extra newlines don't affect the result
In [15]: data = """\
...: a,b,c
...: 1,Yes,2\
...: """
In [16]: pd.read_csv(io.StringIO(data))
Out[16]:
a b c
0 1 Yes 2
In [17]: data = """
...: a,b,c
...: 1,Yes,2
...: """
In [18]: pd.read_csv(io.StringIO(data))
Out[18]:
a b c
0 1 Yes 2
so no need to add these \
here, it's just something to be aware of in case you change to multi-line format in other parts of the docs and there is does make a difference
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.
Oh! Okay! Thank you, I'll remember that! Shall I see if the ones I updated are affected by this or not? And make changes accordingly?
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.
Pretty sure all the ones you updated here are the same as this one (pd.read_csv(io.stringio(...
so I think we're fine here
As for whether there are any tools to do this automatically - I don't think so 😢
If you update the line in line in doc/source/whatsnew/v0.19.0.rst
then I think this is good to go!
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.
Sorry, my bad, this is v0.19.0, you updated it already.
Cool, looks good to me!
Thanks @meghana-12 |
Hey, @dsaxton @MarcoGorelli I have a small request. If you find this PR good enough to be part of hacktoberfest, could you please add the label |
Happy to help, let us know if you'd like any help/mentoring with other issues |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff