![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
Dawang_0v0
这个作者很懒,什么都没留下…
展开
-
operator.itemgetter(*items) @ python
转自官方文档 operator.itemgetter(item) operator.itemgetter(*items)Return a callable object that fetches item from its operand using the operand’s getitem() method. If multiple items are specified, returns转载 2017-09-05 09:57:57 · 389 阅读 · 0 评论 -
小数进制转化 @ Python
# -*- coding: utf8 -*-import ctypesdef h2f(s): cp = ctypes.pointer(ctypes.c_longlong(s)) fp = ctypes.cast(cp, ctypes.POINTER(ctypes.c_double)) return fp.contents.valuedef f2h(s): fp转载 2017-09-06 11:17:43 · 1085 阅读 · 0 评论 -
zip函数的使用
x = [1, 2, 3]y = [4, 5, 6]z = [7, 8, 9]xyz = zip(x, y, z)#xyz = [(1, 4, 7), (2, 5, 8), (3, 6, 9)] 将3个列表中相同索引位置的元素按照顺序生成元组构成列表abc = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]xyz = [(1, 2, 3), (4, 5, 6), (7原创 2017-09-07 16:34:07 · 725 阅读 · 0 评论