随笔分类 -  d:Python

摘要:![](https://img2020.cnblogs.com/blog/323808/202008/323808-20200822100156266-1970446755.png) 阅读全文
posted @ 2020-08-22 10:02 ZH奶酪 阅读(168) 评论(0) 推荐(0) 编辑
摘要:母亲节:五月第二个星期日 #!/usr/bin/env python # -*- coding: utf-8 -*- import calendar month_number = 5 # 五月 sunday_index = 0 # 星期日 date_value_index = 0 cal = cal 阅读全文
posted @ 2020-06-03 10:21 ZH奶酪 阅读(876) 评论(0) 推荐(0) 编辑
摘要:加拿大感恩节是十月第二个星期一。 美国感恩节是十一月第四个星期四。 目前最流行的还是美国的感恩节,下边是计算美国感恩节的代码,改一下参数就可以计算加拿大感恩节了。 #!/usr/bin/env python # -*- coding: utf-8 -*- month = 11 thursday = 阅读全文
posted @ 2020-06-03 10:15 ZH奶酪 阅读(541) 评论(0) 推荐(0) 编辑
摘要:内存分析 guppy:分析整个程序中每种数据类型占用的内存情况;(https://svenil.github.io/guppy pe/ ,https://smira.ru /wp content/uploads/2011/08/heapy.html) memory_profiler:逐行分析一个函数 阅读全文
posted @ 2020-04-24 20:30 ZH奶酪 阅读(1605) 评论(0) 推荐(0) 编辑
摘要:思路:启动max_workers个workers(线程),每个线程处理一份输入数据。 如果自己统计,那还需要对下边的脚本进行扩展。 如果搭配grafana等监控工具使用,那压测脚本只负责疯狂发请求就好了。 阅读全文
posted @ 2020-04-16 16:58 ZH奶酪 阅读(870) 评论(0) 推荐(0) 编辑
摘要:原文:https://zh google styleguide.readthedocs.io/en/latest/google python styleguide/python_style_rules/ comments 分号 不要在行尾加分号, 也不要用分号将两条命令放在同一行. 行长度 每行不超 阅读全文
posted @ 2020-04-03 23:07 ZH奶酪 阅读(518) 评论(0) 推荐(0) 编辑
摘要:https://zhuanlan.zhihu.com/p/67457275 (最近在看《重构》,像我这样只贴了原文的链接,我这应该算是一篇简单的委托博客,😄) 阅读全文
posted @ 2020-04-03 22:24 ZH奶酪 阅读(294) 评论(0) 推荐(0) 编辑
摘要:``` import tensorflow as tf saved_model_dir = "./saved_model" with tf.Session(graph=tf.Graph()) as sess: tf.saved_model.loader.load(sess, ["serve"], saved_model_dir) graph = tf.get_default_graph() [pr 阅读全文
posted @ 2020-04-02 15:51 ZH奶酪 阅读(3018) 评论(0) 推荐(0) 编辑
摘要:Python2的字符串有两种:str 和 unicode;Python3的字符串也有两种:str 和 bytes。 bytes可以是任何二进制数据,文本/图片/视频/音频等等。 str就是文本。 str与bytes互转 略微详细的介绍 Python3 严格区分 (str)和 (bytes)。 可以变 阅读全文
posted @ 2020-03-29 16:22 ZH奶酪 阅读(2734) 评论(0) 推荐(0) 编辑
摘要:参考:https://docs.python.org/zh cn/3/library/2to3.html 2to3是python自带的工具,能处理大部分diff,剩下的还需要手动处理的(我不知道如何自动处理): 【ERROR】str,unicode,bytes的问题; 【WARNING】如果py2代 阅读全文
posted @ 2020-03-27 15:55 ZH奶酪 阅读(1001) 评论(0) 推荐(0) 编辑
摘要:subprocess是py2.4引入的功能,可以代替一些老旧的模块与功能: 优先考虑使用call方法,如果call不满足需求,可以使用 接口。 call subprocess.call(args, , stdin=None, stdout=None, stderr=None, shell=False 阅读全文
posted @ 2020-03-26 14:54 ZH奶酪 阅读(260) 评论(0) 推荐(0) 编辑
摘要:https://stackoverflow.com/questions/11416024/error installing python snappy snappy c h no such file or directory/20678150 20678150 我的开发机是Debian内核,输入下边 阅读全文
posted @ 2020-03-25 17:48 ZH奶酪 阅读(807) 评论(0) 推荐(0) 编辑
摘要:itertools的accumulate()是python3中引入的内置模块, https://docs.python.org/zh cn/3/library/itertools.html 从文档中可以看出,accumulate的功能就是一种累加,例如斐波那契数列。 那么如何在python2中实现呢 阅读全文
posted @ 2020-03-19 10:39 ZH奶酪 阅读(518) 评论(0) 推荐(0) 编辑
摘要:如何在前端进行异步轮询呢?以angularjs的interval方法为例: "https://www.cnblogs.com/CheeseZH/p/12444034.html" 阅读全文
posted @ 2020-03-08 18:40 ZH奶酪 阅读(3987) 评论(4) 推荐(0) 编辑
摘要:"原文链接" 原创: 崔庆才 在 Python 中,一般情况下我们可能直接用自带的 logging 模块来记录日志,包括我之前的时候也是一样。在使用时我们需要配置一些 Handler、Formatter 来进行一些处理,比如把日志输出到不同的位置,或者设置一个不同的输出格式,或者设置日志分块和备份。 阅读全文
posted @ 2019-12-05 21:44 ZH奶酪 阅读(7560) 评论(1) 推荐(0) 编辑
摘要:英文链接:https://mlflow.org/docs/latest/models.html 本文链接:https://www.cnblogs.com/CheeseZH/p/11946260.html 一个MLflow模型是打包机器学习模型的基本格式,可以方便的应用到不同下游工具,例如实时REST 阅读全文
posted @ 2019-11-27 23:05 ZH奶酪 阅读(2969) 评论(0) 推荐(0) 编辑
摘要:英文链接:https://mlflow.org/docs/latest/projects.html 本文链接:https://www.cnblogs.com/CheeseZH/p/11945432.html MLflow项目是一种用于以可复用可复现的方式打包数据科学代码的格式。项目的组件包含了API 阅读全文
posted @ 2019-11-27 22:11 ZH奶酪 阅读(2006) 评论(0) 推荐(0) 编辑
摘要:英文链接:https://mlflow.org/docs/latest/tracking.html 本文链接:https://www.cnblogs.com/CheeseZH/p/11945089.html MLflow Tracking MLflow Tracking组件提供了API和UI,用于记 阅读全文
posted @ 2019-11-27 20:04 ZH奶酪 阅读(4727) 评论(0) 推荐(0) 编辑
摘要:英文链接:https://mlflow.org/docs/latest/tutorial.html 本文链接:https://www.cnblogs.com/CheeseZH/p/11943280.html 这篇教程展示了如何: 1. 训练一个线性回归模型 2. 将训练代码打包成一个可复用可复现的模 阅读全文
posted @ 2019-11-27 16:29 ZH奶酪 阅读(9198) 评论(0) 推荐(0) 编辑
摘要:自己一直使用virtualenv,但是发现很多工具或框架都是以来conda,于是就网上搜了下二者的区别,感觉这篇文章讲的比较清楚:https://blog.csdn.net/zhouchen1998/article/details/84671528 。 1. 什么是virtualenv(venv) 阅读全文
posted @ 2019-11-27 15:44 ZH奶酪 阅读(1239) 评论(0) 推荐(0) 编辑