python
NorthFish北海有鱼
simple notebook.想去硅谷写代码
展开
-
python相关
1.多线程https://my.oschina.net/liuyuantao/blog/1154504https://jingsam.github.io/2015/12/31/multiprocessing.html可以认为for是在提交任务,然后并行算,每个核心去跑对应的任务最后合并结果2.python多线程和c语音有什么不一样3.判别器和生成器......原创 2020-04-25 00:21:00 · 151 阅读 · 0 评论 -
python列表sort
列表里的元组sort按照元组的第一个元素来排列。class Solution: def cutOffTree(self, forest): M = len(forest) N = len(forest[0]) trees = [] for i in range(M): for j in range(N): if (forest[i][j] > 1):原创 2022-05-24 17:28:35 · 104 阅读 · 0 评论 -
python处理json/xml文件
import jsonimport randomimport collectionsfilename = '在线请求0426.txt'# 将数据加载到一个列表中#首先得到所有的商家,把商家设置一个状态,存到一个map里poiid_status_maps={}poiid_shelf_maps= collections.defaultdict(list)shelf_poiid_maps= collections.defaultdict(list)with open(filename) as .原创 2022-04-26 17:57:18 · 993 阅读 · 0 评论 -
哈希表/列表的时间复杂度
Python 各种集合内置方法的时间复杂度_Baoli1008的博客-CSDN博客_python set 时间复杂度python list 之时间复杂度分析 - 简书原创 2022-04-13 15:13:46 · 1832 阅读 · 0 评论 -
python画图工具
import matplotlib.pyplot as pltimport seaborn as snsfrom matplotlib import ticker%matplotlib inlineplt.rcParams['font.sans-serif'] = ['SimHei'] # 中文字体设置-黑体plt.rcParams['axes.unicode_minus'] = False # 解决保存图像是负号'-'显示为方块的问题sns.set(font='SimHei',font_.原创 2022-03-22 17:34:41 · 1109 阅读 · 0 评论 -
python设计模式
Python设计模式——装饰模式(Decorator) - Xjng - 博客园假如我们需要开发一个程序来展示一个人穿衣服的过程。#encoding=utf-8__author__ = 'kevinlu1010@qq.com'class Person(): defhttps://www.cnblogs.com/Xjng/p/3877471.html原创 2021-11-04 20:35:20 · 228 阅读 · 0 评论 -
python一些用法
迭代器,生成器,装饰器原创 2021-04-20 16:43:21 · 96 阅读 · 0 评论