小编sre*_*iam的帖子

在 python 3 中使用 Unicode 希腊符号作为变量

我可以在 Python 中使用 Unicode 符号。作为一名研究人员,这让我很兴奋,因为它可以使我的方程更具可读性。

\n
    \n
  1. 编写涉及多个此类变量的复杂方程会出现问题吗?

    \n
  2. \n
  3. 代码的性能会受到影响吗?

    \n
  4. \n
\n

例如,这是我用 Unicode 字符重新编写的代码中的一段:

\n
# Use iterative solver to find the solution\n\xcf\x86_equi = math_op.itr_sol_search(still, 0, \xcf\x86_max)\n\n# Evaluate the slop of the GZ Curve at the new equilibrium angle\nGZ_slope = math_op.cspline_deriv(\xcf\x86_equi, \xcf\x86_pts, GZ_pts) * 180/\xcf\x80\n\nN_Roll_MI = (m * g * GM_T * T\xcf\x86**2)/(4 * \xcf\x80**2)\nOm_R = sqrt( (m * g * GZ_slope) / N_Roll_MI )  \n
Run Code Online (Sandbox Code Playgroud)\n

python unicode

11
推荐指数
1
解决办法
4572
查看次数

标签 统计

python ×1

unicode ×1