随笔分类 -  python3

摘要:一.两个list差集 a = [1,2,3] b = [2,3] 想要的结果是[1] 下面记录一下三种实现方式: 1. 正常的方式 ret = [] for i in a: if i not in b: ret.append(i) 2.简化版 ret = [ i for i in a if i no 阅读全文
posted @ 2021-08-11 09:08 踏叶乘风 阅读(122) 评论(0) 推荐(0) 编辑
摘要:1.差集 a = [1,2,3] b = [2,3] c = list(set(b).difference(set(a))) # b中有而a中没有的 2 .并集 c = list(set(a).union(set(b))) 3.交集 c=list(set(a).intersection(set(b) 阅读全文
posted @ 2020-06-05 11:51 踏叶乘风 阅读(829) 评论(0) 推荐(0) 编辑
摘要:官网示例文档:http://avro.apache.org/docs/current/gettingstartedpython.html#download_install 需要注意的是,官网给出的是py2.x的示例代码。 py3 需要做一些改动: import avro.schema from av 阅读全文
posted @ 2019-07-11 09:21 踏叶乘风 阅读(2615) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示