Skip to content

Instantly share code, notes, and snippets.

@zhpmatrix
Last active April 10, 2016 08:26
Show Gist options
  • Save zhpmatrix/dc5284ed859636b0cb9a1730b5f71d2b to your computer and use it in GitHub Desktop.
Save zhpmatrix/dc5284ed859636b0cb9a1730b5f71d2b to your computer and use it in GitHub Desktop.
label u for chinese encoding about the python

在学习Scipy的leastsq扩展的时候,发现在中文前会用到'u'标签,这是干什么用的?

例如下述两行代码:


print u'真实参数',[A,k,theta]

pl.plot(x,y1,label = u'噪声数据')

为什么要加入u标签呢?否则中文报错!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment