周刊
各种来源的…
background
世界高速变化
goal
定期 review 一周以来主要变化
trac
汇集各种渠道的周刊, 以及自己每周内省小结吧…
refer.
…TBD
各种来源的…
世界高速变化
定期 review 一周以来主要变化
汇集各种渠道的周刊, 以及自己每周内省小结吧…
…TBD
原文: Import Python Weekly Newsletter - Issue No 152 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 哈希和对等 core-python Most Python programmers don’t spend a lot of time thinking about how equality and hashing works. It usually just works. However there’s quite a bit of gotchas and edge cases that can lead to subtle and frustrating bugs once one starts to customise their behaviour – especially if the rules on how they interact aren’t understood. (是也乎: 任何概念深了说, 都不怎么平易 ) Pygame 搞的视频合成器 - Python 作艺 art, sound, pygame Critter and Guitari have built a bunch of insane video synthesizers that react to live music performance. They’re meant to enhance and automatically accompany a performance. Today, we’ll write a basic video synthesizer in Python, using aubio for Onset detection, and Pygame to display our graphics visually. We’ll end up with a program ready to be played out through a projector. (是也乎: 图样图森破哪…这东西还是硬件来的靠谱 ) Pandas 101: 索引 pandas I’m going to go in depth a bit on two main concepts of Series & Dataframes. And then, what I found helpful in life, is becoming fluent in indexing dataframes. (是也乎: 大坑…还是清洗时,针对最终输出嗯哼好就好 ) Python 去 Go 作弊条儿 golang For Python developer looking to get a taste of Go. Also do subscribe to http://importgolang.com/ to keep a track of Go Ecosystem. (是也乎: 那什么,在这儿推荐这种是否… ) CPython 内部探索 cpython This is a quick guide for people who are interested in learning more about CPython’s internals. It provides a summary of the source code structure and contains references to resources providing a more in-depth view. JIT编译 Python子集到 x86-64 bytecode, JIT This post shows how to write a basic JIT compiler for the Python bytecode, from scratch, using nothing but stock Python modules. (是也乎: scratch??? 的确 bytecode 是个待挖掘的宝藏, 其实从这个环节进行静态化, 优化为毛不行呢? ) GitHub - tryolabs/requestium: 请求到 Selenium 之间的集成层,用于自动化web动作 Selenium, requests Requestium is a python library that merges the power of Requests, Selenium, and Parsel into a single integrated tool for automatizing web actions. The library was created for writing web automation scripts that are written using mostly Requests but that are able to seamlessly switch to Selenium for the JavaScript heavy parts of the website, while maintaining the session. Requestium adds independent improvements to both Requests and Selenium, and every new feature is lazily evaluated, so its useful even if writing scripts that use only Requests or Selenium. (是也乎: Selenium 坚持这么多年,终于熬死了其它前端测试框架统一江湖了啊啊啊啊啊 ) 在5分钟内构建一个Python REST API – Python Rest API Toolkit rest In this post we introduce Arrested?—?A new framework for building REST APIs using Python. We’ll use Docker, SQLAlchemy, and other tools to build a Star Wars themed API in 5 minutes! (是也乎: 动用了 Docker 哪… ) 用Python分析1000多种希腊葡萄酒 scraping In this post I’ll play with the data I scraped from a Greek wine e-shop. In lieu of apology for sending a few more requests to their server I urge everyone browse through their catalog and maybe even buy a few bottles. (是也乎: 分析希腊酒品质分布… ) 用深度学习预测加密货币价格 pandas, LSTM We’ve collected some crypto data and fed it into a supercool deeply intelligent machine learning LSTM model. Unfortunately, its predictions were not that different from just spitting out the previous value. How can we make the model learn more sophisticated behaviours? 10 个Python 面试问题必知必会 interview, 面试经 如何使用 Pandas-DataReade r获得免费的当日期权数据 pandas This is a simple reference article for readers that might wonder where I get/got my options data from. In this regard I would like to shout out the contributors to the pandas-datareader, without their efforts this process would be much more complex. JavaScript 的 Promises 等于 Python 的 asyncio asyncio, js JavaScript promises appear to be very different from Python’s asyncio. But they’re not that different! The code is written differently (the syntax is different), but what is happening under the hood is actually the same (the semantics are equivalent). (是也乎: 这种姿势来蹭热点, 良心不痛嘛? promises 那是被逼的, 在 py3 是原生的 ) 用 Keras 进行 AI 艺术风格转换 image processing, art (是也乎: 叕一个风格理解/合成工具 ) 真正简单的方法来编写 Python 衰变函数 decay At my exercise of reinforcement learning, I needed to write a decay function for ?-greedy strategy. (是也乎: decay … 哈哈, 好形象 ) 用Python 写个网格笔记纸张生成器 code snippets Testing Models with Django using Pytest and Factory Boy django Pytest and Factory Boy make a rad combo for testing Django Applications. pytest-annotate 开源鸟! mypy, dropbox Just a few days ago, Dropbox open-sourced PyAnnotate, a Python library that observes the execution of a Python program and automatically outputs Python type annotations. PyAnnotate greatly simplifies the process of using a type-checker (e.g. Mypy) with a legacy codebase. (是也乎: 老爹到了 Dropbox 后, 动作很多哪… 自动化类型声明补… ) 好物 ~ 包/模块/库/片段… ...
原文: Import Python Weekly Newsletter - Issue No 151 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 用 Python 和 OpenCV 搞增强现实(第1部分| Bites of code opencv You may (or may not) have heard of or seen the augmented reality Invizimals video game or the Topps 3D baseball cards. The main idea is to render in the screen of a tablet, PC or smartphone a 3D model of a specific figure on top of a card according to the position and orientation of the card. (是也乎: 嗯哼, 这个方向上 Py 也有很多积累 ) 高级 Python 程序猿最想把什么技巧传授给嫩枪们? core-python Must read thread. Instagram 在分析 CPython cpython, production Instagram employs Python in one of the world’s largest settings, using it to implement the “business logic” needed to serve 800 million monthly active users. We use the reference implementation of Python, known as CPython, as the runtime used to execute our code. As we’ve grown, the number of machines required toserve our users has become a significant contributor to our growing infrastructure needs. These machines are CPU bound, and as a result, we keep a close eye on the efficiency of the code we write and deploy, and have focused on building tools to detect and diagnose performance regressions. This continues to serve us well, but the projected growth of our web tier led us to investigate sources of inefficiency in the runtime itself. (是也乎: Instagram 用 Python 来服务8亿用户, 但是,依然只是 Python 单体应用最大之一 ) 如何学习 Pandas - 走向数据科学 pandas In this post, I will outline a strategy to ‘learn pandas’. For those who are unaware, pandas is the most popular library in the scientific Python ecosystem for doing data analysis. Pandas 开源采购 ptracer, 面向 Python 的系统跟踪库 Pinterest Making Pinterest faster and more reliable is a constant focus for our engineering team and using hardware resources more efficiently is a major part of this effort. Improving efficiency and reliability requires good diagnostic tools, and today we’re announcing our newest tracing tool: ptracer, which provides granular syscall tracing in Python programs. In this post we’ll cover background on Pinterest’s codebase, why we needed a better tracer and how ptracer can help solve certain engineering problems. Python wat core-python A “wat” is what I call a snippet of code that demonstrates a counterintuitive edge case of a programming language. (The name comes from this excellent talk by Gary Bernhardt.) If you’re not familiar with the language, you might conclude that it’s poorly designed when you see a wat. Often, more context about the language design will make the wat seem reasonable, or at least justified. (是也乎: wat ~ 笏 <– 反直觉的自然设计 ) Blender Python 教程 - 用10行代码实现多米诺骨牌效应 code snippets The Mypy Blog: Dropbox 发布 PyAnnotate – 为 mypy 自动生成类型注释 mypy For statically checking Python code, mypy is great, but it only works after you have added type annotations to your codebase. When you have a large codebase, this can be painful. At Dropbox we’ve annotated over 1.2 million lines of code (about 20% of our total Python codebase), so we know how much work this can be. It’s worth it though: the payoff is fantastic. Django 2.0 rc1 发布 django Django 2.0 release candidate 1 is the final opportunity for you to try out the assortment of new features before Django 2.0 is released. Tangent - By Google neural networks Tangent is a new, free, and open-source Python library for automatic differentiation. In contrast to existing machine learning libraries, Tangent is a source-to-source system, consuming a Python function f and emitting a new Python function that computes the gradient of f. This allows much better user visibility into gradient computations, as well as easy user-level editing and debugging of gradients. Tangent comes with many more features for debugging and designing machine learning models. (是也乎: 和其它机械学习没出息不同, Tangent 工作成果不是计算结果, 是针对具体问题的新代码, 然后再运行…. 哪什么…嗯哼, 你高兴就好. ) ...
原文: Import Python Weekly Newsletter - Issue No 150 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 十个 Sublime 插件值得用于日常 Python/Django 开发 sublime Sublime text editor comes with its basic setup as a normal text editor. We need some set of plugins to make it useful for any real-time development. In this blog post we list ten plugins that will be useful for your daily python/Django development. 加速 SQLite 和 Python sqlite In this post I’d like to share with you some techniques for effectively working with SQLite using Python. 你应该使用哪个 Python 包管理器 ? package manager Everyone who touches code has different preferences when it comes to their programming environment. Vim versus emacs. Tabs versus spaces. Virtualenv versus Anaconda. Today I want to share with you my environment for working with data and doing machine learning. (是也乎: 无论哪种都应该配合 pyenv ) 用 tmtoolkit 在 Python 进行主题模型评估 topic modeling I introduce the Python package tmtoolkit which allows to utilize all availabel CPU cores in your machine by computing and evaluating the models in parallel. We will use topic models based on the Latent Dirichlet Allocation (LDA) approach by Blei et al., which is the most popular topic model to date. (是也乎: 基于 LDA 技术来突破 Py 应用的CPU 限制. ) Python 类的特殊方法或魔术方法 core-python What happens when we create an object in python class ? (是也乎: 叕一个 Python 内部机制解析嗯哼 ) 以 Flask 和 Asyncio 构建 Quart flask, asyncio I recently gave a talk at PyCon UK in Cardiff about building Quart from Flask and Asyncio. The talk itself is on youtube (linked below) and I’ve made the slides available via google slides (also linked below). jardin, a dataframe-based ORM for Python pandas Pandas can be fed a SQL query as a string to return a dataframe. (是也乎: SQL 实在是无法绕过的一个生产力工具 ) Python 来嗯哼 YouTube 数据 youtube The YouTube Data api v3 gives us the access to YouTube videos, channels, search, captions, comments and playlists. (是也乎: 非常好,只是… ) Restful API 测试 testing Tavern is a pytest plugin, command-line tool and Python library for automated testing of RESTful APIs, with a simple, concise and flexible YAML-based syntax. It’s very simple to get started, and highly customisable for complex tests. (是也乎: 叕一个 RESTful 测试工具, 基于 Yaml?! ) pyschemes awesome project PySchemes is a library for validating data structures in Python. PySchemes is designed to be simple and Pythonic. (是也乎: 那什么, 这种面向编程过程, 而不是编译过程的,应该嗯哼的… ) 从头开始编写基本的 x86-64 JIT 编译器 cpython In this post I’ll show how to write a rudimentary, native x86-64 just-in-time compiler (JIT) in CPython, using only the built-in modules. (是也乎: JIT 是另外一个优化姿势了… ) Don Jayamanne, creator of the Python extension for Visual Studio Code, joins Microsoft – Python Engineering at Microsoft Visual Studio I’m delighted to announce that Don Jayamanne, the author of the most popular Python extension for Visual Studio Code, has joined Microsoft! Starting immediately, Microsoft will be publishing and supporting the extension. You will receive the update automatically, or visit our Visual Studio Marketplace page and click “Install”. 构建一个 Python Autocompleter autocompleter Why do you need autocompletion, and how does it work? My talk at PyCon UK 2017 explains how – and why – we built an in-browser autocompleter for Anvil. (是也乎: 最新的浏览器内自动完成能力… ) tt - 布尔表达式工具箱 boolean tt (truth table) is a library aiming to provide a Pythonic toolkit for working with Boolean expressions and truth tables. Please see the project site for guides and documentation, or check out bool.tools for a simple web application powered by this library. (是也乎: 专注 boolean 运算支持的工具 PS: t.tt 不相干的 ) 好物 ~ 包/模块/库/片段… ...
原文: Import Python Weekly Newsletter - Issue No 149 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 技巧: 丹书 book With Python Tricks: The Book you’ll discover Python’s best practices with simple, yet practical examples. You’ll get one step closer to mastering Python, so you can write beautiful and idiomatic code that comes to you naturally. PySpark 用 UDF 引入矢量化 pyspark This blog post introduces the Vectorized UDFs feature in the upcoming Apache Spark 2.3 release that substantially improves the performance and usability of user-defined functions (UDFs) in Python. Pipfile 和 Pipenv : 依赖管理的未来 pipenv Yes, I heared you. pip is a great tool and has been around for quite a long time. But for 3 years or so, people (contributors) have been looking for a way to enhance our packages management experience. Think about the superpowers of composer, npm (or better, yarn) in your favorite tool. What they offer is (more or less) a replacement for the age-old requirements.txt file : the Pipfile. (是也乎: 是的, pip 的潜力远没有挖尽, 毕竟软件生命周期中部署和升级比开发要长的多… ) 用 Python 对排序算法进行可视化 - Python 艺术 visualization Last week there was a great sorting algorithm post by morolin, where they showed an animation of quite a few different sorting algorithms. Morolin built their visualization in Golang. Today, we’ll try implementing our own version, using Python 3. We’ll end up with the following visualizations. (是也乎: 三种排序算法的动态示意… ) 有蒙板的词云示例 visualization A word cloud is a pretty traditional, and maybe already old fashioned way to depict the content of a text or a corpus (a set of texts). Nevertheless it is still a good way to convey the general idea of the text. This form of communication can be further improved by generating a word cloud image which resembles the general idea of the text. This article intends to demonstrate how to generate such a word cloud. 了解分布式 Tensorflow tensorflow One of the biggest/best updates so far on tensorflow is the Distributed Tensorflow functionality. It allows you to scale your training to multiple machines. The tutorial here ?— https://www.tensorflow.org/deploy/distributed is great for folks who are very familiar with in’s and out’s of how tensorflow works. But it doesn’t really explain a lot of the terminology. This post is my journey of struggle with it. 为毛不能用 Python 列表过滤替代 SQL 过滤 benchmark Please don’t filter huge amounts of data in Python when trying to make a dashboard. But instead use a database, because in the end that is what it’s made for. (是也乎: DBA 是 Py 的一个常设领域,只是没有JS 嗯哼的快.. ) 在调查数据集上实践聚类技术 clustering We have practiced Regression problem last time, which is a category of Supervised learning. 数据检索器2.1:Python界面,自动完成和更多 new release We are exited to announce a new release of the Data Retriever, our software for making it quick and easy to get clean, ready to analyze, data. PyPy 状态博客:如何令您的代码快 80 倍 pypy I often hear people who are happy because PyPy makes their code 2 times faster or so. Here is a short personal story which shows PyPy can go well beyond that. (是也乎: 从快5倍开始优化的, 现在80倍了, 基本追上 golang 的基本线了? ) SQLAlchemy 中的多表过滤器 SQLAlchemy For my team at Spring, one of the benefits of moving from Go to Python was being able to use a mature, field-tested ORM library such as SQLAlchemy. When the system you’re putting together grows over fifty tables, you learn to appreciate this powerful tool. (是也乎: SQLAlchemy 终于多年的媳妇熬成婆了 ) Python 中更快的物理库 robotics, simulation We’re open-sourcing a high-performance Python library for robotic simulation using the MuJoCo engine, developed over our past year of robotics research. (是也乎: 机械人工厂也是 py 进入的领域了 ) 用 Python 探索美国警务数据 data science (是也乎: 等等, 这种操作合法嘛? ) 从Postgres 到 Python 的 1M行/秒 async asyncpg is a new fully-featured open-source Python client library for PostgreSQL. It is built specifically for asyncio and Python 3.5 async / await. asyncpg is the fastest driver among common Python, NodeJS and Go implementations. (是也乎: 只能说 Pg 太屌了… ) 用 Python 收集 Twitter 数据 - Alexander Galea的博客 twitter This post explains generally how my Python 3 tweet searching script works. Twitter limits the maximum age of searchable tweets to roughly a week. As such, the script can search for tweets posted up to just over a week ago. Twitter also limits the maximum number of tweets downloaded in every 15 minute interval. (是也乎: 嗯哼?好象有开放接口可以直接获得的? ) 好物 ~ 包/模块/库/片段… ...