1.chr() ascii码-->数值
与此相对
ord() 数值-->ascii码
print(chr(112))
---p
print(ord('p'))
---112
2.np.random.permutation()
对括号里的值或列表,随机排序
import numpy as np
a=np.random.permutation(6)
print(a)
---->[3 2 4 0 1 5]
import numpy as np
a=np.random.permutation([1,2,3,4,5,6])
print(a)
---->[3 2 6 5 1 4]
3.import unicodedata
unicodedata.categary(str)
返回str在UNICODE里的分类类型
[Cc] Other, Control
[Cf] Other, Format
[Cn] Other, Not Assigned (no characters in the file have this property)
[Co] Other, Private Use
[Cs] Other, Surrogate
[LC] Letter, Cased
[Ll] Letter, Lowercase
[Lm] Letter, Modifier
[Lo] Letter, Other
[Lt] Letter, Titlecase
[Lu] Letter, Uppercase
[Mc] Mark, Spacing Combining
[Me] Mark, Enclosing
[Mn] Mark, Nonspacing
[Nd] Number, Decimal Digit
[Nl] Number, Letter
[No] Number, Other
[Pc] Punctuation, Connector
[Pd] Punctuation, Dash
[Pe] Punctuation, Close
[Pf] Punctuation, Final quote (may behave like Ps or Pe depending on usage)
[Pi] Punctuation, Initial quote (may behave like Ps or Pe depending on usage)
[Po] Punctuation, Other
[Ps] Punctuation, Open
[Sc] Symbol, Currency
[Sk] Symbol, Modifier
[Sm] Symbol, Math
[So] Symbol, Other
[Zl] Separator, Line
[Zp] Separator, Paragraph
[Zs] Separator, Space