码迷,mamicode.com
首页 >  
搜索关键字:tuples    ( 155个结果
生成器与迭代器
容器(container) 容器是一种把多个元素组织在一起的数据结构,容器中的元素可以逐个地迭代获取,可以用in, not in关键字判断元素是否包含在容器中。通常这类数据结构把所有的元素存储在内存中(特殊情况除外,比如迭代器和生成器对象)在Python中,常见的容器对象有: list, deque ...
分类:其他好文   时间:2018-09-30 19:53:44    阅读次数:190
生成器与迭代器
迭代器:具有一个next()函数 凡是可作用于for循环的对象都是Iterable类型; 凡是可作用于next()函数的对象都是Iterator类型,它们表示一个惰性计算的序列; 集合数据类型如list、dict、str等是Iterable但不是Iterator,不过可以通过iter()函数获得一个 ...
分类:其他好文   时间:2018-09-17 19:52:57    阅读次数:136
Python PEP8 编码规范中文版
英文原文:PEP 8 -- Style Guide for Python Code 1. Introduction 介绍 本文提供的Python代码编码规范基于Python主要发行版本的标准库。Python的C语言实现的C代码规范请查看相应的PEP指南1。 这篇文档以及PEP 257(文档字符串的规 ...
分类:编程语言   时间:2018-09-03 20:32:18    阅读次数:190
python collections
namedtuple() Factory Function for Tuples with Named Fields They can be used wherever regular tuples are used, and they add the ability to access field ...
分类:编程语言   时间:2018-08-14 17:50:49    阅读次数:270
ddt-数据驱动
import unittestfrom ddt import ddt, data, unpack@ddtclass FooTestCase(unittest.TestCase): @data((3, 2), (4, 3), (5, 3)) @unpack def test_tuples_extrac ...
分类:其他好文   时间:2018-06-28 20:21:42    阅读次数:750
序列中连续值之间的差值列表
迭代器每迭代一次就会消耗一个元素,是一次性的。所以会得到对迭代器对象求和结果为0 http://python.jobbole.com/89181/ ...
分类:其他好文   时间:2018-06-16 23:37:38    阅读次数:302
省赛 F: Four-tuples
时间限制: 10 Sec 内存限制: 128 MB 题目描述 Given l1,r1,l2,r2,l3,r3,l4,r4, please count the number of four-tuples (x1,x2,x3,x4) such that li≤ xi≤ ri and x1≠x2,x2≠x ...
分类:其他好文   时间:2018-06-04 22:38:26    阅读次数:191
storm trident 如何标记一个batch被处理——coordinator spout
Splitting a stream has no effect on the batch. If you join the stream back together, then yes, it will be the same batch. Tuples are passed between pa ...
分类:其他好文   时间:2018-05-27 10:43:15    阅读次数:158
AtCoder - 3962 Sequence Growing Hard
Problem Statement Find the number of the possible tuples of sequences (A0,A1,…,AN) that satisfy all of the following conditions, modulo M: For every i ...
分类:Windows程序   时间:2018-05-22 18:24:27    阅读次数:232
python常用序列list、tuples及矩阵库numpy的使用
近期开始学习python机器学习的相关知识,为了使后续学习中避免编程遇到的基础问题,对python数组以及矩阵库numpy的使用进行总结,以此来加深和巩固自己以前所学的知识。 Section One:Python数组的使用 在python中,数组这个概念其实已经被淡化了,取之的是元组和列表,下面就列 ...
分类:编程语言   时间:2018-04-04 15:05:40    阅读次数:300
155条   上一页 1 2 3 4 5 6 ... 16 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!