周刊
各种来源的…
background
世界高速变化
goal
定期 review 一周以来主要变化
trac
汇集各种渠道的周刊, 以及自己每周内省小结吧…
refer.
…TBD
各种来源的…
世界高速变化
定期 review 一周以来主要变化
汇集各种渠道的周刊, 以及自己每周内省小结吧…
…TBD
原文: Import Python Weekly Newsletter - Issue No 128 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 保持 Python 竞争力 core-python Victor Stinner sees a need to improve Python performance in order to keep it competitive with other languages. He brought up some ideas for doing that in a 2017 Python Language Summit session. No solid conclusions were reached, but there is a seemingly growing segment of the core developers who are interested in pushing Python’s performance much further, possibly breaking the existing C API in the process. (是也乎: 运行时性能爱好者们的嗯哼… ) 用 Luigi 构建并监视批量处理的管道 luigi, pipeline Luigi is a Python module that helps you build complex pipelines of batch jobs. It handles dependency resolution, workflow management, visualisation etc. It also comes with Hadoop support built in. 机器学习和数学的 Python 作弊条 machine learning Curated list of cheatsheets. (是也乎: 讲真, 图形的不如 ipynb 那种可运行的… ) PyGotham 2017 - 主题征集ing pygotham PyGotham is a New York City based, eclectic, Py-centric conference covering many topics. There’s a diverse speaker list, and some things which will be quite different. PyGotham attracts developers of various backgrounds and skill levels from the New York metropolitan area and beyond. Activities include two full days of talks, lightning talk sessions, and a social event. pyenv 和 cron pyenv Do not use /root/.pyenv/shims/python . Use direct python in pyenv. (是也乎: 其实, 更加 Pythonic 的方案是脱离 cron 使用 python 原生的定期任务模块 ) 用 10 行 Python 构建个文章基础拼写检查器 codesnippet Build a naive Article Spell-checker in 10 Lines of Python Code. Paranoid 的包检查器 security 用 Elizabeth 生成模拟数据: Part II mocking Elizabeth is a Python library, which helps generate mock data. Part II of the tutorial we shared previously. Infoblox Bulk DNS 追加 codesnippet Python 中的记录,结构,数据传输对象 core-python How to implement records, structs, and “plain old data objects” in Python using only built-in data types and classes from the standard library. (是也乎: ) 只有升级到 Py3 才能享受的 10 大极赞特性 core-python (是也乎: 可下载的 pdf 版本幻灯: 10 awesome features 高级解包 ~ 追加了变参数,以及更直觉的操作 关键词参数 ~ 能模式匹配了 Chained 异常 ~ 能返回更多信息了 更好的追踪子类 OSError 一切都能迭代了 更加严格的比较了 ~ 原先一切都能相互嗯哼不行了 yield from ~ 形式上更加明显进行嗯哼了 asyncio ~ 重点广告特性 标准库追加了几个 Fun ~ 中文|emoji 变量/类/函式名, 区分了 Unicode and bytes 矩阵运算支持 Pathlib ~ 只希望 win 系统也相同支持的更加自然… ) Apache Kafka 简介 kafka In this blog post, we’re going to get back to basics and walk through how to get started using Apache Kafka with your Python applications. Picard music Picard is a cross-platform music tagger written in Python. This is a fairly old package. 好物 ~ 包/模块/库/片段… ...
原文: Import Python Weekly Newsletter - Issue No 127 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 函式不是你所想咯 core-python, functions Python functions cannot have names. In this world view, every function is a nameless, anonymous object. Code like “def to_percent(numbers)” creates a nameless function object, then stores it in a variable called “to_percent”. (是也乎: 不同的世界观中, Py 的函式机制都可以自洽 ) Python API 清单 checklist Useful checklist for build good Python libraries APIs. Based on “How to make a good library API” PyCon 2017 talk. (是也乎: PyCon2017 最新主题分享的检查列表, ) Api Star video This is a presentation I gave at a local python user group in Nashville, PyNash. The topic of the night was to pick a lesser-known or up and coming library that many folks may not be aware of yet and give a 10 minute overview. (是也乎: ✨ 🚀 ✨ 真的解决大问题的好思路… 等等: API STAR by Anthony Fox 这种幻灯平台,简直了… ) 实现基于角色的访问控制 role easyrbac has a very simple API to interact around and create Roles and Users Ethereum 周刊 - #offtopic newsletter If you are into cryptocurrency check out Ethereumweekly.com started by a friend. It’s a weekly newsletter on all things Ethereum, Blockchain. A good way to understand what the buzz on cryptocurrency is all about. (是也乎: 有关网络安全/区块链 的周刊 ) 用 Python 和 Pandas 对价格进行分析和评级 pandas I recently began investing and was wondering how good analysts are at predicting the future of a company. 用 Machine Learning 进行文本分类 machine learning In this post, we will be trying to make a text classifier that will make use of the 20 news groups dataset originally developed by Ken Lang to classify documents into different categories based on their content. 在 Python 中用起 YAML YAML YAML stands for “YAML Ain’t Markup Language” and is mostly used in configuration files. YAML, in contrary to JSON, is made to be very readable and is not designed to be used for api’s or other communication protocols. This is because the parsing of a YAML file requires the computer a little bit more effort than parsing a JSON file. (是也乎: Yaml 虽然比 JSON 可读,但是无论创建和解析都比较嗯哼… ) 转换 cURL 指令为 Python requests curl Web app to convert syntax. (是也乎: 德政! 这才是为用户着想,将系统管理员从 shell 中扑救出来.. <– Convert curl syntax to Python, Node.js, PHP ) Riddler Nation 擂台冠军; 基于代理的建模方法 | Curtis Miller’s Personal Website numpy, pandas, quiz, puzzle Solution to Oliver Roeder puzzle in in FiveThirtyEight called “The Riddler”. 在 Python 用 Excel-样 列名来索引 codesnippet (是也乎: 就两行代码: def to_idx(letters): val = lambda i, x: (26**i) * (ord(x.lower()) - ord(‘a’) + 1) return sum([val(i, x) for i, x in enumerate(letters[::-1])]) - 1 效果: to_idx(‘A’) 0 to_idx(‘AH’) 33 to_idx(‘XFD’) 16383 ) ...
原文: Import Python Weekly Newsletter - Issue No 126 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… PyCon 2017 视频已经在 YouTube pyconus, pycon Videos of the just concluded Pycon US 2017. (是也乎: 准备和 UPYUN 合作批量搬迁到国内… ) 如何获得 PyPI 下载状态? bigquery, pipy This is a short post on how to get download statistics about any package from PyPI. Though there have been efforts in that direction from sites like pypi ranking but this post finds a better solution. Google has been generous enough to donate it’s Big Query capacity to the Python Software Foundation. You can access the pypi downloads table through the Big Query console. I ran a sample query to find out how my personal package arachne has been doing on PyPI. (是也乎: Google Big Query 已经监控了… ) SQLAlchemy 简介 - Agiliq Blog SQLAlchemy The breadth of SQLAlchemy’s SQL rendering engine, DBAPI integration, transaction integration, and schema description services are documented here. In contrast to the ORM’s domain-centric mode of usage, the SQL Expression Language provides a schema-centric usage paradigm. (是也乎: 无数种草文又一则 ) The Meaning of Underscores in Python core-python The various meanings and naming conventions around single and double underscores (“dunder”) in Python, how name mangling works and how it affects your own Python classes. (是也乎: ) Python: 好物 Objects 来袭 PyObject In Python, all object types inherit from one master object, declared as PyObject . This master object has all of the information Python needs to process a pointer to an object as an actual object. 调试一个安静的 Python 进程 debugging So we had a production case for months together, where the python process was stuck for indefinitely long time (even days) with absolutely zero activity but the process was listed as active and running by linux. A restart would fix the problem (as always) and the job would be live and kicking. Finally after sometime, I have found the root cause, so I thought I would share it. For the purpose of the blog I’m going to simulate the behavior of my application in a sample python script. (是也乎: 其实就是一个长期运行的 py 进程的调试技巧, 尝试模拟来激发bug… 最后还是回到了 GDB ) 用 Python 驱动 Headless Chrome chromium, headless Back in April, Google announced that it will be shipping Headless Chrome in Chrome 59. Since the respective flags are already available on Chrome Canary, the Duo Labs team thought it would be fun to test things out and also provide a brief introduction to driving Chrome using Selenium and Python. (是也乎: 太应景了…只是用 selenium 来调, 肥了点儿? ) 用 Elizabeth 生成 mock 数据: Part I mock Elizabeth is a Python library, which helps generate mock data for various purposes. The library was written with the use of tools from the standard Python library, and therefore, it doesn’t have any side dependencies. Currently the library supports 30 languages and 19 class providers, supplying various data. Python 3 boilerplate boilerplate Python-boilerplate.com is a collection of Python boilerplates for getting started quickly and right-footed. 如何用 Python 计算文档相似度? gensim 用 Python + Asyncio 和 Scrape 以及 Parse 达到 600个/10分钟 的 ETF 分析速度 scraping 教程: 用 Python 进行异步语音识别 speech recognition (是也乎: 用的 google 接口, 其实讯飞的也足够了 ) PyCon JP Blog: PyCon JP 2017 开始接收 Poster-Session Proposals pyconjp PyCon JP 2017 is Now Accepting Poster-Session Proposals! PyCon JP 2017 is a perfect opportunity to connect with a wide range of people. Poster sessions allow you to make the most of that opportunity. PyCon 2017 头天感想 pycon Python 3 Patterns, Recipes and Idioms — Python 3 Patterns, Recipes and Idioms idioms (是也乎: 完整的一木书了… Bruce Eckel <– 专门写 Think in * 的大仙, 当年 Tink in Java 看的是欲仙欲死… ~ Bruce Eckel’s MindView, Inc: Books by Bruce Eckel 对了, 唯一太监的就是 Think in Python ) 嗯哼你的 Python IDE atom Using Atom IDE. (是也乎: VScode vs Atom vs others ) Global 变量在 Python 并不是全局的 core-python, global Python uses global to reference to module-global variables. There are no program-global variables in Python. (是也乎: 模块全局,不是程序全局, 真正的全局变量, 在移动互联网时代,只能是第三方广播服务了 ) 大师访谈: The Unique Characters Problem interview 获得 Python Requirements Package Hashes pip, nodejs, requirement.txt Python’s (pip’s) requirements.txt file is the equivalent to package.json in the JavaScript / Node.js world. This requirements.txt file isn’t as pretty as package.json but it not only defines a version but goes a step further, providing a sha hash to compare against to ensure package integrity: 好物 ~ 包/模块/库/片段… ...
原文: Import Python Weekly Newsletter - Issue No 125 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… How to Publish Your Package on PyPI? pypi When you’ve written some great code, you might want to make this available for others to use as well. The pythonic way of sharing a package is making it available on PyPI. Let’s create a simple package and go through the process of publishing it! (是也乎: 简单的说, PyPI 还在独立打造专用软件仓库, 实在是…. ) Python 测试与 pytest:简单,快速,有效和可扩展 来自 Brian Okken |实用书架 testing, book Do less work when testing your Python code, but be just as expressive, just as elegant, and just as readable. The pytest testing framework helps you write tests quickly and keep them readable and maintainable—with no boilerplate code. Using a robust yet simple fixture model, it’s just as easy to write small tests with pytest as it is to scale up to complex functional testing for applications, packages, and libraries. This book shows you how. Dhruv Govil 聊 Python 在电影工业中的作用 podcast Movies are magic, and Python is part of what makes that magic possible. We go behind the curtain this week with Dhruv Govil to learn about how Python gets used to bring a movie from concept to completion. He shares the story of how he got started in film, the tools that he uses day to day, and some resources for further learning. (是也乎: 自古就和 3D 电影的看作绑定在一起了,列表一下俺不知道的: Rez Alembic Geometry Storage Format Fabric Engine Pyblish … ) 用 Python 对 NY 的出租车数据建立 ML 分类器以便生成推荐 bigquery, datawarehouse I demonstrate the power of the Google BigQuery engine by building a classifier which will predict whether a NY city taxi ride will result in a generous tip or no tip at all. As part of doing this I explore the dataset and look at relationships in the dataset. I also visualize the pickups around the city and the result is a scatterplot which essentially draws the city streets of NY. (是也乎: Google BigQuery 的又一个 demo ) 用 Python 和 Google Docs 构建图书 docx Daniel ( Co-Author of Two Scoops of Django ) shares how he put Python ( python-docx library ) along with Google Docs to create his latest self-published fiction book. (是也乎: .docx 的爱恋… ) 将 Sublime Text 嗯哼成最好的全桟 Python IDE sublime3 Train/Test Split and Cross Validation in Python data science Argparse vs Click CLI Command line arguments processing library. (是也乎: 简单的说, 哪个顺手哪个就是你最好的… ) Python 在 Mac OSX 中的合理部署 installation, macos-x (是也乎: 还在使用 virtualenv … 这种中古环境控制技术了… ) 用 Python 和 Mxnet 构建机器学习的现代人脸识别 machine learning In this post, we’ll discuss and illustrate a fast and robust method for face detection using Python and Mxnet. 南方公园文本分析 - 第1部分:TF-IDF machine learning I noticed recently that Kaggle has an interesting dataset?—?70,000 lines of South Park dialogue. It’s nicely labelled by episode and character. I figured it would be a good practical test for the TF-IDF tools in scikit learn that I’ve been wanting to try recently. (是也乎: 著名 TV 的台词大数据也慢慢公开出来了, 相同的技术可以用来分析各种古典文学作品的… ) 用 Python Generator 来监视数据 videos David Beazley demonstrates how to use a generator in Python to watch real-time data sources. This is an excerpt from the Pearson video course “Python Programming Language”. 拼写与元素符号 codesnippet Sitting in my 5-hour-long chemistry class, my gaze would often drift over to the periodic table posted on the wall. To pass the time, I began to try finding words I could spell using only the symbols of the elements on the periodic table. Some examples: ScAlEs, FeArS, ErAsURe, WAsTe, PoInTlEsSnEsS, MoISTeN, SAlMoN, PuFFInEsS. I wondered what the longest such word was (‘TiNTiNNaBULaTiONS’ was the longest one I could come up with). Then I started thinking about how nice it would be to have a tool that could find the elemental spellings of any word. I decided to write a Python program. lambda, map 和 filter 在 Python core-python, lamda, map, filter lambda operator or lambda function is used for creating small, one-time and anonymous function objects in Python. Pandas DataFrames 和 MultiIndex 简单演示 pandas Pandas Dataframes generally have an “index”, one column of a dataset that gives the name for each row. It works like a primary key in a database table. But Pandas also supports a MultiIndex, in which the index for a row is some composite key of several columns. It’s quite confusing at first, here’s a simple demo of creating a multi-indexed DataFrame and then querying subsets with various syntax. (是也乎: Pandas 中最好用也是最嗯哼的, 就是 dataframes 上的索引了… ) Python + Docker: 从开发到生产:第一集 dockers 制定最大化收入的定价策略 numpy, pandas, scipy Turns out, selling lemonade is a perfect scenario to introduce dynamic pricing and price optimization techniques. In this post, we’ll be finding an optimal price for our glasses of lemonade using some basic methodology in Python in order to maximize our revenue. Pandas 和 Python 真实世界项目 (GPS data) pandas Analysis and plotting of GPS data using pandas 2017 年 Python 最赞的 15 个数据科学库 data science As Python has gained a lot of traction in the recent years in Data Science industry, I wanted to outline some of its most useful libraries for data scientists and engineers, based on recent experience. And, since all of the libraries are open sourced, we have added commits, contributors count and other metrics from Github, which could be served as a proxy metrics for library popularity. (是也乎: 讲真,无论库发展的如何,最后拼的还是平台服务哪 ) 用 AWS Lambda 检查 PCAP 文件 aws, lamda, pcap, scapy AWS Lambda is a service that allows you to run code without provisioning a server. This has some interesting possibilities especially when processing data asynchronously. When I first started learning about Lambda most of the examples were about resizing images. I work with PCAP files on a daily basis and have used scapy for several years so thought it would be a good experiment to use Lambda to do some simple PCAP inspection. 好物 ~ 包/模块/库/片段… ...