You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
471
+
472
+
By default, "Ambiguous" character's width, "¡" (inverted exclamation) in below example, is regarded as 1.
473
+
474
+
.. note::
475
+
476
+
This should be aligned properly in terminal which uses monospaced font.
Enabling ``display.unicode.ambiguous_as_wide`` lets pandas to regard 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 not aligned properly because the setting is mismatched with this environment.
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v0.17.0.txt
+31
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,7 @@ Highlights include:
49
49
- Support for reading SAS xport files, see :ref:`here <whatsnew_0170.enhancements.sas_xport>`
50
50
- Documentation comparing SAS to *pandas*, see :ref:`here <compare_with_sas>`
51
51
- Removal of the automatic TimeSeries broadcasting, deprecated since 0.8.0, see :ref:`here <whatsnew_0170.prior_deprecations>`
52
+
- Display format with plain text can optionally align with Unicode East Asian Width, see :ref:`here <whatsnew_0170.east_asian_width>`
52
53
- Compatibility with Python 3.5 (:issue:`11097`)
53
54
- Compatibility with matplotlib 1.5.0 (:issue:`11111`)
54
55
@@ -334,6 +335,36 @@ Google BigQuery Enhancements
334
335
- The ``generate_bq_schema()`` function is now deprecated and will be removed in a future version (:issue:`11121`)
335
336
- Update the gbq module to support Python 3 (:issue:`11094`).
336
337
338
+
.. _whatsnew_0170.east_asian_width:
339
+
340
+
Display Alignemnt with Unicode East Asian Width
341
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
342
+
343
+
.. warning::
344
+
345
+
Enabling this option will affect the performance for printing of DataFrame and Series (about 2 times slower).
346
+
Use only when it is actually required.
347
+
348
+
Some East Asian countries use Unicode characters its width is corresponding to 2 alphabets. If DataFrame or Series contains these characters, default output cannot be aligned properly. The following options are added to enable precise handling for these characters.
349
+
350
+
- ``display.unicode.east_asian_width``: Whether to use the Unicode East Asian Width to calculate the display text width. (:issue:`2612`)
351
+
- ``display.unicode.ambiguous_as_wide``: Whether to handle Unicode characters belong to Ambiguous as Wide. (:issue:`11102`)
0 commit comments