码迷,mamicode.com
首页 >  
搜索关键字:iterable    ( 1284个结果
spring-boot-单元测试
pom依赖 快捷键 ctrl + shift + t service层 测试 controller 测试 断言 Assert.assertThat使用 Junit基本注解介绍 @BeforeClass 在所有测试方法前执行一次,一般在其中写上整体初始化的代码 @AfterClass 在所有测试方法后 ...
分类:编程语言   时间:2018-12-07 14:45:45    阅读次数:330
自定义的类创建的对象使用len(x)函数和abs(x)函数
class Mylist: '''自定义的容器类,内部使用内建的列表保存数据''' def __init__(self, iterable): self.data = [x for x in iterable] def __repr__(self): return "Mylist(%s)" % se ...
分类:其他好文   时间:2018-11-28 12:13:17    阅读次数:201
python基础之内置函数与匿名函数
python基础之内置函数与匿名函数 内置函数68个如下图 重点的关注的内置函数len,sorted,enumerate,all,any,zip,filter,map,reversed,slice len(o):参数为O,返回数据类型的长度sorted(): sorted(iterable, cmp ...
分类:编程语言   时间:2018-11-27 10:11:36    阅读次数:209
spark完整的数据倾斜解决方案
1、数据倾斜的原理 2、数据倾斜的现象 3、数据倾斜的产生原因与定位 在执行shuffle操作的时候,大家都知道,我们之前讲解过shuffle的原理。 是按照key,来进行values的数据的输出、拉取和聚合的。 同一个key的values,一定是分配到一个reduce task进行处理的。 多个k ...
分类:其他好文   时间:2018-11-25 16:11:02    阅读次数:247
es6数组新方法
es6给我们带来了更多更便利的数组方法,开熏!! 1Array.from Array.from方法用于将两类对象转为真正的数组:类似数组的对象(array like object)和可遍历(iterable)的对象(包括 ES6 新增的数据结构 Set 和 Map)。 比如我们在获取标签时如果使用的 ...
分类:编程语言   时间:2018-11-25 13:10:32    阅读次数:243
TypeError: add() argument after * must be an iterable, not Settings的错误原因
在抄代码的时候发现有个错误: TypeError: add() argument after * must be an iterable, not Settings 看不懂,百度才知道原因,原来是第2行的 _init_ 写成了 _int_ ...
分类:其他好文   时间:2018-11-25 01:22:57    阅读次数:1186
python常用函数 C
1. Counter(hashable) 直接使用统计可哈希元素每个元素的数量。 2. most_common:可以统计数量最多的n个元素。 3. compress(iterable, callable) 根据序列去选择输出对应位置为 True 的元素。 4. choice(iterable) ra ...
分类:编程语言   时间:2018-11-22 11:45:38    阅读次数:201
python总结
map()函数 map(function, iterable) #例如 def square(x): return x*x print (map(square, [1,2,3,4,5])) print (list(map(square, [1,2,3,4,5]))) <map object at 0 ...
分类:编程语言   时间:2018-11-20 15:10:04    阅读次数:261
从零开始的Python学习 知识补充sorted
sorted()方法 sorted()可用于任何一个可迭代对象。 原型为sorted(iterable, cmp=None, key=None, reverse=False) iterable:一个可迭代对象; cmp:用于比较的函数,比较什么由key决定; key:用列表元素的某个属性或函数进行作 ...
分类:编程语言   时间:2018-11-18 22:39:07    阅读次数:205
复习迭代器 VS 生成器
可迭代对象( iterable ) 是实现了__iter__()方法的对象 迭代器( iterator)是实现了__iter__()和__next__()方法的对象 可迭代对象( iterable )通过调用 iter() 方法得到一个 迭代器( iterator) ...
分类:其他好文   时间:2018-11-17 22:45:53    阅读次数:206
1284条   上一页 1 ... 35 36 37 38 39 ... 129 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!