周刊
各种来源的…
background
世界高速变化
goal
定期 review 一周以来主要变化
trac
汇集各种渠道的周刊, 以及自己每周内省小结吧…
refer.
…TBD
各种来源的…
世界高速变化
定期 review 一周以来主要变化
汇集各种渠道的周刊, 以及自己每周内省小结吧…
…TBD
原文: Import Python Weekly Newsletter - Issue No 104 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 房价的可负担性 - 用 Apache Spark apache spark Back in September last year, the Guardian published a fantastic visualisation looking at house price affordability in the United Kingdom. The raw data is easily available from data.gov.uk, and they provide monthly, annual and the complete history allowing you to work with a reasonably sized set before running on the complete data set. Recreating the Guardian’s data process within Apache Spark felt like a great way to get an introduction into the platform. (是也乎: 卫报编辑的折腾…这年头什么行业都不易哪 ) Sanic 入门: 基于异步/uvloop 的 web 框架仅 Python 3.5+ 支持 python3, sanic, webserver uvloop has been making waves in the Python world lately as a blazingly fast drop-in for asyncio’s default event loop. Sanic is a Flask-like, uvloop-based web framework that’s written to go fast. Sanic is made for Python 3.5 . The framework allows you to take advantage of async/await syntax for defining asynchronous functions. With this, you can write async applications in Python similar to how you would write them in Node.js. (是也乎: 目测退化为 py2 兼容的,才是成功的 ) 命名实体分类 machine learning, NLP This blog post describes three prototype solutions for the task of Named Entity Classification in the context of Booking.com. The aim is to present different approaches to the classification task, analyse their implementation and compare them in a small scale prototype use case. Sample code in Python is also provided in the following sections for each model described. pdb 到 bug humor If you have watched / heard the famous dialog from the movie taken, you will be able to understand this funny meme. 如何图形化 Python 调试器 debugging Zero-to-Debugging in 15 mins. Complementing Python With Rust rust-lang (是也乎: 又来… rust 语言发展求突破, py 这么帮不是个办法 ) 如何用 Python 重采样并插入时宜序列数据 pandas In this tutorial, you will discover how to use Pandas in Python to both increase and decrease the sampling frequency of time series data. Pythonic 代码复审 (Red Hat Security Blog) code quality Most of us programmers go through technical interviews every once in a while. At other times, many of us sit on the opposite side of the table running these interviews. Stakes are high, emotions run strong, intellectual pressure builds up. I have found that an unfortunate code review may turn into something similar to a harsh job interview. (是也乎: 其实庄表伟在 gitchat 中的系列嗯哼非常实用的了. ) Django Weekly Issue 18 djangoweekly This weeks roundup insightful articles, videos on everything Django. (是也乎: 以后 Django 相关的嗯哼,可以到专用周刊中挖掘了… 顺便先作一下 The State of the Developer Nation Survey 2017 有中文版本的 ) 介绍 Maya: 人性的数据时间 - By Kenneth Reitz open source project Datetimes are a headache to deal with in Python, especially when dealing with timezones, especially when dealing with different machines with different locales. Maya exists to do all the hard work for you, so you can focus on what you’re trying to do — import or export simple datetime data in known human and machine-readable formats. (是也乎: 处理海量数据时,时间对准越来越头痛了… ☀ Say Thank You ) 和 Python 函式编程相关的精选列表 open source project (是也乎: 竟然有这种萌物! ) 用 TensorFlow 进行交通标志识别 machine learning, tensorflow In this part, I’ll talk about image classification and I’ll keep the model as simple as possible. In later parts, I’ll cover convolutional networks, data augmentation, and object detection. Python 3 in one image infpgraph (是也乎: ) 谁可解释 David Beazley 的 tweet ? discussion I am glad someone on reddit asked this. I can’t get some of David’s tweets. It’s from his book I learned Python. If you are on twitter follow him. (是也乎: 迷之代码的嗯哼… def spam(): X: auto @ property.template X(*T, …) = object class Y(X): pass return Y() 如果 Py3 越来越象C++ 那基本上是嗯哼的 ) 好物 ~ 包/模块/库/片段… ...
原文: Import Python Weekly Newsletter - Issue No 103 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… PyCon Canada 视频 video, conference, pycon-canada PyCon Canada’s Youtube channel now has most of the event’s videos. (是也乎: 当然的 油管儿的…) 通过 Python 函式进行追踪 debugging python-execution-trace allows you to choose what function you are interested in and it records its execution(s), together with the local state. You can then step through any execution, both forwards and backwards. All you need to do is pip install the library, decorate the target function and run your code as you normally do. (是也乎: Py3 的库, python-execution-trace 妄想恢复当年 C++ 的单步追踪的体验.. ) 课程:用 Python 获取 web 数据 - By University of Michigan scraping This course will show how one can treat the Internet as a source of data. We will scrape, parse, and read web data as well as access data using web APIs. 在 Python 中如何规范化/标准化时间序列数据 time-series Some machine learning algorithms will achieve better performance if your time series data has a consistent scale or distribution. Two techniques that you can use to consistently rescale your time series data are normalization and standardization. In this tutorial, you will discover how you can apply normalization and standardization rescaling to your time series data in Python. (是也乎: 嗯哼?! 居然要动用机械学习!? ) 一次奇异的 Python 内存泄漏追踪 - By Benoit Bernard debugging “I thought that memory leaks were impossible in Python?”, I said to myself, staring incredulously at my screen. It was 8:00 PM. The memory use of my crawler was slowly, but steadily increasing. As I hadn’t changed any significant portion of my code, this made no sense at all. Had I introduced a new bug? If so, where was it? Here follows the full story of how I tracked down a memory leak in my Python application. Note - Benoit Bernard is writing these long form articles on his debugging experiences it’s worth reading. (是也乎: 为了挖出来问题根源…. 应该使用火熖图了吧? ) Mypy 如何简化编译 Python 的 mypy The Mypy static type-checking project for Python is exploring ways it could aid with effortlessly compiling Python into C or machine language (是也乎: 一切为了编译为 C, 可是为毛?! ) Python Snippetizer snippets, website Python snippets for beginners to explore. Python 3.6 中的语法糖 python3.6 Simple code snippets showing us what’s new in Python 3.6. (是也乎: 这世界上语法糖最多的可能是 Ruby 语言了,然后呢?! ) Why I’m Making Python 2.8 placeholder For the past two months I’ve been spending half my time on Python 2.8. Python 2.8 is a backwards-compatible Python interpreter that runs Python 2 code and C-extensions exactly as-is, while also allowing Python 2 programmers to use the most exciting new language features from Python 3. These new backported language features include async/await syntax, function annotations and typing support, keyword-only arguments, and new metaclass syntax, among many others. I use Python 2.8 as my system python now, and haven’t had any problems running my old 2.7 code or using packages like IPython, pip, numpy, pandas, requests, and flask. (是也乎: 细思恐极,官方声称放弃 Py2 后,江湖中果断有英雄出面! 2.8 准备继承 Py 2 的遗产, 并成为可以同时运行 Py2和Py3 代码的更加兼容的环境! 已经编译出来的 Py2.8 运行当前所有重要的常见模块/框架都没有问题… ) 在 Python 中提高异常敏度- By Moshe Zadka exception handling There is a lot of Python code in the wild which does something like raise SomeException(“Could not fraz the buzz: {} is less than {}".format(foo, quux)). This is, in general, a bad idea. Exceptions are not program panics. 谁测试了什么 - By Ned Batchelder coverage The next big feature for coverage.py is what I informally call “Who Tests What.” People want a way to know more than just what lines were covered by the tests, but also, which tests covered which lines. (是也乎: 越来越关心具体的测试序列对应的覆盖行区块了… ) 好物 ~ 包/模块/库/片段… ...
原文: Import Python Weekly Newsletter - Issue No 102 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 如何用 Python 代码来捕获环线地铁上的流氓? pandas Singapore’s MRT Circle Line was hit by a spate of mysterious disruptions in recent months, causing much confusion and distress to thousands of commuters. Like most of my colleagues, I take a train on the Circle Line to my office at one-north every morning. So on November 5, when my team was given the chance to investigate the cause, I volunteered without hesitation. (是也乎: 通过一系列的数据分析,将非法乘车的人群行为可视化, 相关 ipynb 下载:datagovsg-blog/circle-line-analytics 问题是, 新加坡哪! 传说中治安最好的国家之一呢… ) 线程异步魔法以及具体的折腾 python3, asyncio A dive into Python’s asyncio tasks and event loops. The asyncio package allows us to define coroutines. These are code blocks that have the ability of yielding execution to other blocks. They run inside an event loop which iterates through the scheduled tasks and executes them one by one. A task switch occurs when it reaches an await statement or when the current task completes. (是也乎: Py3 也就只能将这拿来说事儿了 ) Python 加载语句中的命名约定.用 BigQuert 对 Github DB Dump 进行探索 github, bigquery Fun article by Florin Badita using BigQuery over entire github hosted Python project’s code base. (是也乎: 细思恐极~ GitHub Data | BigQuery Documentation | Google Cloud Platform GitHub 应该是拿到了 Google 的免费接口支持, 所以能实时的将所有开源项目的仓库数据同步到 BigQuery 上, 这带来了一个直接后果: 我们提交的代码已经变成了互联网意识的一部分! 嗯哼,各种代码代码风格的优劣,现在有了直接的数据支持,可以客观的知道当前世界上程序猿们的真实心理动态了…. 比如: 这个月使用 tab 的多过空格的, 可能是 win13 发布带来的小高潮…etc. Tabs or spaces(圣战分析) 当然有很多技巧的, 主表 [bigquery-public-data:github_repos.contents] 已经 1.5 TB, 不是一般人承担的了查询费用的… ) Tensorflow: 如何用 Python 接口冻结模型并使用 tensorflow, machinelearning We are going to explore two parts of using a ML model in production. How to export a model and have a simple self-sufficient file for it ? How to build a simple python server (using flask) to serve it with TF ?. (是也乎: 又一个用 Flask 落地 TF 服务的案例 ) 四大 Python 可能的未来之纠缠 What does the future hold for Python, aside from new versions of the language ? (是也乎: 嗯哼, Py2 LL&P ) 基于 Microsoft Cognitive 服务和 Python 构建私人 ChatBot chatbots ChatBot is the new buzz word for a while. Microsoft Cognitive Services API allows you to built ones that allow your app to process natural language and learn how to recognize what users want. (是也乎: 就是这种邪恶的免费接口,将程序猿训练为了向企业 AI 投食的机械人! 嗯哼,俺也将给 Cognitive 输入整个儿红楼梦,是否能变成可吟诗的 Bot ? ( ̄▽ ̄) 也支持 Jupyter … M$ 一点儿也不落后. ) 用 Python 可视化 Tweet 向量 data-mining, gensim, tweets I created a semi-practical application that reads from the Twitter stream, parses tweets, and does some machine learning magic to score the tweet’s sentiment and project it into a two-dimensional grid, where tweets with similar content will appear closer to each other. It does all of this more or less in real time using asynchronous messaging. (是也乎: 实时获得 Twitter 的情绪变化 ) 在 Xcode 中跑 Python : 步骤 — Erica Sadun xcode, apple As I’m preparing for a project that will involve Python programming, I need to get up to speed with at least a basic level of Python mastery. However, I’m not a big fan of using the interactive Python REPL. I decided to use Xcode instead, and I’m finding it a much better solution for my needs: (是也乎: Hummm 何苦泥… ) 用 Pickle 进行对象序列化 pickle Introductory article on usage of pickle module. (是也乎: 之前曰过 eevee/camel: Python serialization for adults 更加嗯哼. ) 和 AWS Lambda 一起用 Numba aws, lambda, numba In a recent project, we decided to use Lambda to execute some fairly math-y Python code in response to user click events on a webpage. Originally this back-end Python code had utilized the Numba library to speed up its execution. However, we quickly found that it was not trivial to make Lambda and Numba play nicely together. (是也乎: 事实一再证明 AWS 工程师不是吃素的… Numba 这种基于 LLVM 加速的并发分析工具,都可以简单的移植到 Lambda 中跑起来… ) unittest 中最赞的你应该知道却不一定知道的特性 subTest From time to time I like to read documentation of modules I think I know well. The python documentation is not a pleasant read but sometimes you strike a gem. (是也乎: 所谓灯下黑呗. 终于有子测试了… ) Pytho 中的高级句式匹配 string_maching FuzzyWuzzy is a fantastic Python package which uses a distance matching algorithm to calculate proximity measures between string entries. (是也乎: 使用距离算法来对整句进行相似度分析,当然不支持 中文先… ) 通过异常类定义另你的自制类更加可读 video, screencast, exception_handling In this short screencast I’ll walk you through a simple code example that demonstrates how you can use custom exception classes in your Python code to make it easier to understand, easier to debug, and more maintainable. (是也乎: 其实吧,还是代码写简单点儿最好了. ) 好物 ~ 包/模块/库/片段… ...
原文: Import Python Weekly Newsletter - Issue No 101 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Quiz Results quiz Thanks everyone for participating in the quiz. Nico Ekkart, Chad Heyne, Artem Bezukladichnii, Andrew Nester and Kyle Monson Congrats. Your copies of Writing Idiomatic Python is on its way. The Answers are on the blog post. ImportPython Subscribers can get a copy of Writing Idiomatic Python for a special price at https://jeffknupp.com/writing-idiomatic-python-ebook-importpython-q2vwt5/ . Thank you Jeff. (是也乎: 上次的问卷结果出来了… ) 俺们如何部署 Python 代码 ? - Nylas deployment Building, packaging, and deploying Python using versioned artifacts in Debian packages. At Nylas, we’ve developed a better way to deploy Python code along with its dependencies, resulting in lightweight packages that can be easily installed, upgraded, or removed. And we’ve done it without transitioning our entire stack to a system like Docker, CoreOS, or fully-baked AMIs. (是也乎: 老梗了,两年前就推荐过,这团队折腾到最后使用了 Debian 专用的 dh-virtualenv 工具, 对于多数团队而言,嗯哼的… ) 如何进行代码格式化令你的 Python 出色? code-quality In Python code reviews I’ve seen over and over that it can be tough for developers to format their Python code in a consistent way: extra whitespace, irregular indentation, and other “sloppiness” then often leads to actual bugs in the program. Luckily automated tools can help with this common problem. Code linters make sure your Python code is always formatted consistently – and their benefits go way beyond that. (是也乎: Flake8+Sublime 的培训课程广告 ) 在 Python 中检查所有条件匹配 - By Trey Hunner core-python Use of any/all with generator expressions for improved readability and code clarity. (是也乎: 运用内建函式 any/all ) 如何成为对冲基金的 Python 程序猿, by the CTO of AHL interview We asked Collier what it takes to code in Python for a major quant fund. – And whether learning how to code as a second career after trading is actually viable. This is what he said. (是也乎: AHL?! 折腾宇宙奥密的 CTO 也转行基金了!? 突然理解了 洪教授… ) 计算科学和工程的 Python 3 book It’s a free book available for download. This text summarises a number of core ideas relevant to Computational Engineering and Scientific Computing using Python. The emphasis is on introducing some basic Python (programming) concepts that are relevant for numerical algorithms. The later chapters touch upon numerical libraries such as numpy and scipy each of which deserves much more space than provided here. We aim to enable the reader to learn independently how to use other functionality of these libraries using the available documentation (online and through the packages itself). (是也乎: 免费图书,用 py3 来演示计算科学领域中各种常见任务的解决, 也介绍了 numpy/scipy 等等关键库. ) Django, fast: part 2 django In this second follow-up post Patryk Zawadzki makes use of wrk benchmarking tool and shows us the performance of gunicorn, uwsgi, PyPy. Besides benchmarking there is good insights into do’s and don’t of each deployment option. (是也乎: 用标准的基准工具来测量 Django 的效能瓶颈 ) Python 内存管理 memory management One of the things you should know, or at least get a good feel about, is the sizes of basic Python objects. Another thing is how Python manages its memory internally. (是也乎: 其实吧,看中国原创的 Python 源代码鉴赏 更加能明白 ) Python 和虚拟环境 virtual environment A tour/tutorial of everything virtualenv. (是也乎: pyenv 早已是每天无法离开的命令了,当然, M$ 中嗯哼的. ) 聊哈对象 “优化”: slots 以及 namedtuples. performance 用 HTRC 特性提取器在 Python 中折腾文本挖掘 data mining We introduce a toolkit for working with the 13.6 million volume Extracted Features Dataset from the HathiTrust Research Center. You will learn how to peer at the words and trends of any book in the collection, while developing broadly useful Python data analysis skills. (是也乎: 基于 1360万卷文献资料的折腾… 可编程历史学 国外各种领域的研究,除了论文发布,关联的重要发布就是一个个的开放数据包. 细思恐极. 当然也使用 ipynb 来组织和展示. ) Awesome Django Admin django-admin Curated list of awesome django resources aptly named Awesome Django Admin . If you have seen Awesome Python, it’s on the same lines. Contribute to it. (是也乎: 细思恐极哪, Awesome 系列是 github 中实事上的好物集锦前缀, 但是, Django Admin 只是一个框架中的一个功能,竟然也能攒出一个 Awesome 来… 这得复杂到什么地步哪… ) 好物 ~ 包/模块/库/片段… ...