令机器学习投入生产

原文: PyCoder's Weekly - Issue #425

pycoder

  • 200617 Zoom.Quiet(大妈) 用时 42 分钟 完成快译
  • 200617 Zoom.Quiet(大妈) 用时 37 分钟 完成格式转抄.

Millions of web apps get deployed to production every day. But machine learning models aren’t web apps. And very few people are talking about deployment. Learn how tools like Streamlit can help take the edge off deploying your machine learning models.

In this step-by-step course, you’ll learn about generators and yielding in Python. You’ll create generator functions and generator expressions using multiple Python yield statements. You’ll also learn how to build data pipelines that take advantage of these Pythonic tools.

(是也乎:

Generators

)

The Pew Research Center’s Data Labs team has open sources two Python libraries for wrangling files and cleaning up text documents.

(是也乎:

目测, 这个研究库, 马上将被和谐.

)

Performance optimization is a tricky subject and silver bullets are rare. This article shines a light on some of the common misconceptions around async Python, like “async is always faster.” Related discussion on Hacker News.

(是也乎:

初学者困境...

就是非常容易被这种看似公允的测试说明相信一个断言.

真实场景中:

1、异步 web 服务器不可使用 reverse proxy,因为 async server 性能高于 reverse proxy。瓶颈位置在 reverse proxy 和 wsgi 层而非 web server。使用 reverse proxy 是因为多线程 context 切换成本高,开不了很多,所以需要一个能无限开 context 的异步服务器(nginx)挡在前面。而本身异步的服务器不需要。

2、异步 web server 不可使用 connection pool 和消息队列,因为无论是协程还是纯单线程异步,协程数和连接数都用不完。由于不存在多线程或者多进程的 context 切换成本,导致只能起有限的线程数,所以需要连接池。异步的连接数用不完,所以不需要连接池,否则会成为瓶颈。

3、异步服务器在并发数超过 1000 时才会明显体现出来,sync 服务器即使在使用 reverse proxy 的情况下由于中间的代理损耗也很难处理 1000 以上的并发。我在对异步服务器做性能测试的时候,是测试程序先挺不住,真实测试异步服务器的性能的技术含量不低,初学者做不到。

这篇作品槽点太多,先说以上几点。一个个讲过来,要打一天的字。

<-- 摘录隔壁群中对此文章的部分观点.

简单说, 对异步和协程的理解, 文章测试出发点就有问题.

)

In Fall 2020, LEGO will release a new Mindstorm Robot Inventor kit that allows children of all ages to build robots out of LEGO and program them with Python.

(是也乎:

LEGO 可能才是 Python 流行的最大推手.

)

“Django 3.1 beta 1 is now available. It represents the second stage in the 3.1 release cycle and is an opportunity for you to try out the changes coming in Django 3.1. Django 3.1 has a potpourri of new features which you can read about in the in-development 3.1 release notes.”

Explore and analyze the wonders and mysteries of space… with Python!

(是也乎:

其实, 一直有支持, 只是在 Musk 之后, 大家才以为是真的.

)

讨论

Discussions

Set 𝑓 = 1729. Now print(f) prints 1729! Excuse me, but I have questions!

collections.Counter and itertools to the rescue!

Hint: Regular expressions. Lots of them.

文章,教程和嗯哼

Articles, Tutorials and Talks

Python keywords make up the fundamental building blocks of any Python program. In this tutorial, you’ll learn the basic syntax and usage for each of Python’s thirty-five keywords so you can write more efficient and readable code.

(是也乎:

Keywords

好绿...

)

If your program crashes because it’s out of memory, how do you figure out where the memory issue occurs? The Fil memory profiler can help you out!

(是也乎:

俗称验尸技法.

)

You can’t loop over an integer in Python… unless you change the source code! Learn how to make integers iterable by altering the CPython source code. Also learn why this is a bad idea.

In this tutorial, you’ll learn about views and copies in NumPy and Pandas. You’ll see why the SettingWithCopyWarning occurs in Pandas and how to properly write code that avoids it.

(是也乎:

SettingWithCopyWarning

高级技巧.

)

Share your passwords safely with friends and family, even if you don’t trust a couple of them, just as an ancient and wise king well versed in Python once did.

(是也乎:

加密和口令, 本身就是矛盾的事儿吧...

安全和麻烦成正比的.

)

See how Go and Python stack up from the perspective of a data engineer by implementing the Mandelbrot set in both languages.

Have you wanted to work with PDF files in Python? Maybe you want to extract text, merge and concatenate files, or even create PDFs from scratch. Are you interested in building hardware projects using a Raspberry Pi? Then check out this episode of the Real Python Podcast.

(是也乎:

David Amos

)

“PostgreSQL JSON fields are a really convenient way of storing structured data alongside traditional row/column values, but when using them in SQLAlchemy you should be mindful of how changes are detected.”

Build an interactive dashboard exploring Messi and Ronaldo’s games during the 2017-18 LaLiga season using Python and Streamlit.

TLDR is a daily, curated newsletter with links and TLDRs of the most interesting stories in tech, science, and programming.

好物

Interesting Projects, Tools and Libraries, Projects & Code

(是也乎:

MicroscoPy

提供微雕精度的开源 3D 打印系统.

)

(是也乎:

模拟自然绘制过程的嗯哼... )

(是也乎:

pew 连击... 事实库, 开放各种社会现实数据给大家研究.

是 pew 慈善信托的子公司出资运维的.

)

(是也乎:

叕一个 AWS 生态衍生品.

)

(是也乎:

基于 PostgreSQL JSONB ? 应该就是个 Pg 的拓展包?

怪不得项目名起的这么随便.

)

📆🐍 活动/大会

Events, MeetUp 真的是全球线下活动组织中心

NIL

(是也乎:

又一周空窗;

中国也已经接到有关通知, 允许线下集会申报了...

而且今年程序员节可能有超级大会.

)

DAMA

❤️ Happy Pythonic ;-(大妈私人无责任播报)

101camp9py 在报名(能开发票 ;-)

报名

课程规划:
    开始报名 2020.5.31
    报名截止 2020.6.21
    正式开课 2020.6.28
    课程结束 2020.8.09

详情 => 蟒营™ Python 入门班第9期

PS:


NN 4047

好文笔,感叹号年度配额: 1/3

投稿/反馈邮箱:

askdama@googlegroups.com

(邮件列表地址, 当成正常邮件发送邮件就好, 不用注册, 不用翻越...)


ZoomQuiet/大妈

就是四处 是也乎,( ̄▽ ̄) 的那个大妈:

私自嗯哼: ZoomQuiet (订阅号: ZoomQuiet42)
公开课程: 蟒营 (订阅号: Mainium)
历史吐糟: Chaos42 (订阅号 PythoniCamp)

as 创始组织者:
    PyChina (订阅号: PyChinaOrg)
    本地社区: 
        GDG珠海 (订阅号: GDG-ZhuHai)
        TFUG珠海 (订阅号: ZH_TFUG)

RPP


Comments


大妈的多重宇宙 - YouTube

全新自媒体系列...科学幻想,读书,说故事...
点击注册~> 获得 100$ 体验券: DigitalOcean Referral Badge

订阅 substack 体验古早写作:
Zoom.Quiet’s Chaos42 | Substack


关注公众号, 持续获得相关各种嗯哼:
zoomquiet


蟒营®编程思维提高班Python版

**2021.01.11** 因大妈再次创业暂停定期开设, 转换为预约触发:
  • + 任何问题, 随时邮件提问可也:
    askdama@googlegroups.com
-->