python
github_元宝
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
测试数据生成
import matplotlib as mplimport numpy as npimport sklearnimport pandas as pdimport osimport sysimport timeimport tensorflow as tffrom tensorflow import kerasprint(tf.__version__)print(sys.version_info)for module in mpl, np, pd, sklearn, tf, ker原创 2021-05-08 15:59:49 · 223 阅读 · 0 评论 -
python-list处理例子
a = [(1,2), (3, 4), (5, 6)]c, d = zip(*a)print(c, d)(1, 3, 5) (2, 4, 6)原创 2021-05-08 14:52:26 · 117 阅读 · 0 评论 -
unicodedata 字符处理例子
>>> import unicodedata>>> import sys>>> cmb_chrs = dict.fromkeys(c for c in range(sys.maxunicode)... if unicodedata.combining(chr(c)))...>>> b = unicodedata.normalize('NFD', a)>>> b原创 2021-05-08 14:51:05 · 489 阅读 · 0 评论 -
numpy相关
np.random.randint(2, size=10)array([1, 0, 0, 0, 1, 1, 0, 0, 1, 0]) # randomnp.random.randint(1, size=10)array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])numpy.random.randint¶原创 2021-05-07 14:27:47 · 122 阅读 · 0 评论 -
python format 用法及使用
不设置指定位置,按默认顺序设置指定位置字典设置参数列表索引设置参数传入对象str.format() 格式化数字>>>"{} {}".format("hello", "world") # 不设置指定位置,按默认顺序'hello world' >>> "{0} {1}".format("hello", "world") # 设置指定位置'hello world' >>> "{1} {0} {1}".format("hell.原创 2021-04-04 10:20:11 · 124 阅读 · 0 评论
分享