Jupyter 错误地显示带有阿拉伯语和字母数字元素的 Python 列表 [英] Jupyter misdisplying Python lists with Arabic and alphanumeric elements

查看:16
本文介绍了Jupyter 错误地显示带有阿拉伯语和字母数字元素的 Python 列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于包含阿拉伯字符串元素和拉丁字母数字字符串元素的列表,我在 Jupyter(Classic 和 JupyterLab)中遇到了显示问题.例如,如果您运行:

en = '7X'打印 (zh)ar = 'عربي'打印 (ar)打印 ([zh, ar])打印 ([ar, en])

这是你得到的:

显然,在阿拉伯语是第一个元素的情况下,Jupyter 遵循 RTL 对齐方式,首先在右侧显示 ar 元素,但我不知道为什么 'X' 从字母数字元素跳转或如何解决这个问题.

顺便说一下,这就是 Spyder 打印出相同代码的方式:

解决方案

点击打印出来的,切换到正确的位置.

<预><代码>>>>打印([ar,en])['عربي', '7X']#点这里^

我相信这是一个仅适用于阿拉伯语的错误.我用中文试了一下没有问题.我会尝试对其进行更多研究并更新此答案.

I am running into a display problem in Jupyter (both Classic and JupyterLab) for lists that include Arabic string elements and Latin Alphanumeric string elements. For example, if you run:

en = '7X'
print (en)
ar = 'عربي'
print (ar)
print ([en, ar])
print ([ar, en])

Here is what you get:

Obviously, where Arabic is the first element, Jupyter follows an RTL alignment displaying the ar element first on the right, but I don't know why the 'X' jumps from the alphanumeric element or how to fix that.

By the way, this is how Spyder prints out the same code:

解决方案

Click on the print out to switch it to the correct position.

>>> print([ar,en])
['عربي', '7X']
#Click Here^

I believe this is an error that only applies to Arabic. I tried it with Chinese without problem. I'll try to do more research on it and update this answer.

这篇关于Jupyter 错误地显示带有阿拉伯语和字母数字元素的 Python 列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆