Skip to content

Commit 0d239d9

Browse files
gef756jreback
authored andcommitted
DOC: correct grammar in unicode section (#17678)
1 parent 5279a17 commit 0d239d9

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

doc/source/options.rst

+13-8
Original file line numberDiff line numberDiff line change
@@ -474,10 +474,10 @@ Unicode Formatting
474474
Enabling this option will affect the performance for printing of DataFrame and Series (about 2 times slower).
475475
Use only when it is actually required.
476476

477-
Some East Asian countries use Unicode characters its width is corresponding to 2 alphabets.
478-
If DataFrame or Series contains these characters, default output cannot be aligned properly.
477+
Some East Asian countries use Unicode characters whose width corresponds to two Latin characters.
478+
If a DataFrame or Series contains these characters, the default output mode may not align them properly.
479479

480-
.. note:: Screen captures are attached for each outputs to show the actual results.
480+
.. note:: Screen captures are attached for each output to show the actual results.
481481

482482
.. ipython:: python
483483
@@ -486,8 +486,9 @@ If DataFrame or Series contains these characters, default output cannot be align
486486
487487
.. image:: _static/option_unicode01.png
488488

489-
Enable ``display.unicode.east_asian_width`` allows pandas to check each character's "East Asian Width" property.
490-
These characters can be aligned properly by checking this property, but it takes longer time than standard ``len`` function.
489+
Enabling ``display.unicode.east_asian_width`` allows pandas to check each character's "East Asian Width" property.
490+
These characters can be aligned properly by setting this option to ``True``. However, this will result in longer render
491+
times than the standard ``len`` function.
491492

492493
.. ipython:: python
493494
@@ -496,9 +497,10 @@ These characters can be aligned properly by checking this property, but it takes
496497
497498
.. image:: _static/option_unicode02.png
498499

499-
In addition, Unicode contains characters which width is "Ambiguous". These character's width should be either 1 or 2 depending on terminal setting or encoding. Because this cannot be distinguished from Python, ``display.unicode.ambiguous_as_wide`` option is added to handle this.
500+
In addition, Unicode characters whose width is "Ambiguous" can either be 1 or 2 characters wide depending on the
501+
terminal setting or encoding. The option ``display.unicode.ambiguous_as_wide`` can be used to handle the ambiguity.
500502

501-
By default, "Ambiguous" character's width, "¡" (inverted exclamation) in below example, is regarded as 1.
503+
By default, an "Ambiguous" character's width, such as "¡" (inverted exclamation) in the example below, is taken to be 1.
502504

503505
.. ipython:: python
504506
@@ -507,7 +509,10 @@ By default, "Ambiguous" character's width, "¡" (inverted exclamation) in below
507509
508510
.. image:: _static/option_unicode03.png
509511

510-
Enabling ``display.unicode.ambiguous_as_wide`` lets pandas to figure these character's width as 2. Note that this option will be effective only when ``display.unicode.east_asian_width`` is enabled. Confirm starting position has been changed, but is not aligned properly because the setting is mismatched with this environment.
512+
Enabling ``display.unicode.ambiguous_as_wide`` makes pandas interpret these characters' widths to be 2.
513+
(Note that this option will only be effective when ``display.unicode.east_asian_width`` is enabled.)
514+
515+
However, setting this option incorrectly for your terminal will cause these characters to be aligned incorrectly:
511516

512517
.. ipython:: python
513518

0 commit comments

Comments
 (0)