周刊
各种来源的…
background
世界高速变化
goal
定期 review 一周以来主要变化
trac
汇集各种渠道的周刊, 以及自己每周内省小结吧…
refer.
…TBD
各种来源的…
世界高速变化
定期 review 一周以来主要变化
汇集各种渠道的周刊, 以及自己每周内省小结吧…
…TBD
原文: Import Python Weekly Newsletter - Issue No 108 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 用 Apache Spark 对8千万 Amazon 产品进行嗯哼 apache spark I wrote a simple Python script to combine the per-category ratings-only data from the Amazon product reviews dataset curated by Julian McAuley, Rahul Pandey, and Jure Leskovec for their 2015 paper Inferring Networks of Substitutable and Complementary Products. The result is a 4.53 GB CSV that would definitely not open in Microsoft Excel. The truncated and combined dataset includes the user_id of the user leaving the review, the item_id indicating the Amazon product receiving the review, the rating the user gave the product from 1 to 5, and the timestamp indicating the time when the review was written (truncated to the Day). We can also infer the category of the reviewed product from the name of the data subset. (是也乎: 是的,现在公开的数据早已超过了 Excel 的能力! ) 语法~变量注释 variable annotation Python 3.6 added another interesting new feature that is known as Syntax for variable annotations. (是也乎: 为了性能, Py3 向 C++ 飞奔而去 ) 每个 Python 项目应该有什么? code quality Over the past few years, the Python programming language gained a huge popularity boost and its community grew faster than ever. With this growth, a lot of tools appeared that help the community keep things organized and accessible. In this article I am going to provide a short list of iteOver the past few years, the Python programming language gained a huge popularity boost and its community grew faster than ever. With this growth, a lot of tools appeared that help the community keep things organized and accessible. In this article I am going to provide a short list of items every Python project should have in order to be accessible and maintainable.ms every Python project should have in order to be accessible and maintainable. (是也乎: 这是又一份看起来简单,但是,坚持作到不容易的 check-list requirements.txt/setup.py/Tests/Documentation/Conclusion 以及一个不言则明的目录结构! ) 跟踪一个奇怪的Python内存泄漏 - 来自 Benoit Bernard debugging Benoit’s first article we shared couple of issues back talked about the memory leak in his crawler and how he found the culprit. In this second and final post of the series, you’ll find out how Benoit used a combination of techniques and tools to analyze and resolve memory leaks in his Python application. (是也乎: 这是个系列内存传说记述, ) 购物蓝分析 – 用 Python 分析可能组合 machine learning Have you ever asked yourself how the store managers decide on product shelf placement in retail stores? There must be some strategy behind it, right? It can’t be just a random choice. Almost on daily basis, you receive product purchase recommendations from variety of sources where you have left your “digital fingerprint”. In many cases these recommendations make sense, what leaves you puzzled, how did they figured it out? (是也乎: 揭示零售卖场货架布置的背后动机… ) 使用 Apache Spark 和 Catalyst 与 Kevin Beyer 构建现代数据发现和 BI 平台 spark Apache Spark Meetup talk on: Building a modern data discovery and BI platform using Apache Spark and Catalyst with Kevin Beyer 32x 倍提速: numpy, pandas, spark, tensorflow 以共同运行时(Weld) 在Python中应用高斯朴素贝叶斯分类器: 第一部分 machine learning, naive bayes Python requests 深挖 requests Lessons learned by replacing httplib in Apache Libcloud with requests. AWS Lambda 初学者指南 - 免费电子书 serverless, FAAS Author Michael Hausenblas explores several use cases where serverless is a great fit—primarily short-running, stateless jobs in event-driven architectures found in mobile or IoT applications. He also provides a guide for migrating from a monolithic application structure to serverless computing. The code snippet in the last chapter is in Python. Though it’s a toy application. 了解Python的下划线 core-python While the underscore is used for just snake-case variables and functions in most languages (Of course, not for all), but it has special meanings in Python. If you are python programmer, for in range(10) , init(self) like syntax may be familiar. 使用算法的文本分类 naive bayes Understanding how chatbots work is useful. A fundamental piece of machinery inside a chat-bot is the text classifier. Let’s look at the inner workings of an algorithm approach: Multinomial Naive Bayes. This is a classic algorithm for text classification and natural language processing (NLP). Fancy terms but how it works is relatively simple, common and surprisingly effective. (是也乎: 针对 chatbots 技术 ) Python代码库中最常用的单词 visualization (是也乎: 嗯哼… ) 对象内省的两个快速函数 - 作者 Vasudev Ram core-python As a curator I can state that Vasudev Ram is definitely one of the most consistent Python blogger in terms of no of articles / code snippets he writes. 好物 ~ 包/模块/库/片段… ...
原文: Import Python Weekly Newsletter - Issue No 107 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 将数据加载入 Pandas DataFrame: 硬的和爽的方法 pandas Data exploration, manipulation, and visualization start with loading data, be it from files or from a URL. Pandas has become the go-to library for all things data analysis in Python, but if your intention is to jump straight into data exploration and manipulation, the Canopy Data Import Tool can help, instead of having to learn the details of programming with the Pandas library. (是也乎: Canopy 有专用工具来加速,只是 Canopy 环境非常嗯哼… ) 推介 Python 类型注释 - By Guido Van Rossum, Greg Price, and David Fisher video, Guido Dropbox has several million lines of production code written in Python 2.7. As a first step towards migrating to Python 3, as well as to generally make our code more navigable, we are annotating our code with type annotations using the PEP 484 standard and type-checking the annotated code with mypy. In this talk we will discuss lessons learned and show how you too can start type-checking your legacy Python 2.7 code, one file at a time. We will also describe some of the many improvements we’ve made to mypy in the process, as well as some other tools that come in handy. (是也乎: 百万行代码级别的 py2->3 迁移经验分享… 有 Guido 座镇的项目都如此艰难,那么… py2 的确命不能绝也. ) 用 Python 处理 bug 并达到 186k requests/second sanic Sanic is a Python3 framework built using the somewhat newly introduced coroutines, harnessing uvloop and based on Flask. However, it had an issue preventing it from utilizing multiple processes correctly. (是也乎: 又一个 web 应用框架 Sanic, 当然主要面向 py3 ) 使用 AWS Lambda 中的 Python 来索引 Amazon Elasticsearch 服务中的 Metadata aws, elasticsearch, lambda, s3 Objects in S3 contain metadata that identifies those objects along with their properties. When the number of objects is large, this metadata can be the magnet that allows you to find what you’re looking for. Although you can’t search this metadata directly, you can employ Amazon Elasticsearch Service to store and search all of your S3 metadata. This blog post gives step-by-step instructions about how to store the metadata in Amazon Elasticsearch Service (Amazon ES) using Python and AWS Lambda. (是也乎: Lambda 哪, 神器,无主机微服务. ) 用 Pythonic 的姿态来搞 APIs tutorial Communication with external services is an integral part of any modern system. Whether it’s a payment service, authentication, analytics or an internal one?—?systems need to talk to each other. In this short article we are going to implement a module for communicating with a made-up payment gateway, step by step. (是也乎: 教程揭示了一个支付网关接口的形成过程 ) Python 工作环境配置终极指南 environment When you’re beginning, it’s pretty easy to setup your Python environment on Unix. But in time things can get messy due to multiple versions, interpreters, utilities and projects. (是也乎: 果断 pyenv+iPython ) “生成器: Python 中最嗯哼的迭代” Luciano Ramalho Iterables, iterators and generators are a key subject for effective Python usage, especially when processing large-scale data sets. Do you know why zip(*M) allows efficient traversal of a matrix M by columns? From the elegant for statement through list/set/dict comprehensions and generator functions, this talk shows how the Iterator pattern is so deeply embedded in the syntax of Python, and so widely supported by its libraries, that some of its most powerful applications can be overlooked by programmers coming from other languages. 在 Windows 机器中部署 Python 的三种方式 windows, installation One of the downsides is that despite the Python community’s attempts to make it an accessible tool for everyone, a lot of folks find the installation process daunting or confusing, including myself. Once I’d learned enough Python to tinker around, I didn’t know where to “go” on my computer to write it or what to do next. Today I’ll cover three ways to install Python on your Windows computer step by step. (是也乎: Rodeo->Anaconda->官方 图样图森破,俺推荐 Python(x,y) ) 从 PDF 输出表格到 Python DataFrame pandas, pdf, data frame It is simple wrapper of tabula-java and it enables you to extract table into DataFrame or JSON with Python. You also can extract tables from PDF into CSV, TSV or JSON file. (是也乎: 果断得通过中间纯数据文件转换. ) 半小时部署一个 Python 的 Telegram bot 到 Azure bot, telegram Almost two years ago Telegram let developers create bots quite painlessly. You can read an introduction about it on Telegram website. In this article we will create a simple bot in python, it’ll be hosted in Azure using Bottle framework. The bot will not do anything fancy, consider it as a template for your python based bots. (是也乎: 嗯哼?!是用 Bottle 开发的!? ) 用 Python 进行 Bayesian A/B 测试 statistics, Bayesian TensorBoard: 可视化学习 | TensorFlow tensorflow 介绍 TensorFlow: 解决一个简单的回归问题 Today I’ll try to explain how to hack TensorFlow to solve a simple regression problem. 属性访问是如何工作的? cpython Have you ever wondered how the CPython interpreter handles attribute access on a class or an instance of a class ? 好物 ~ 包/模块/库/片段… ...
原文: Import Python Weekly Newsletter - Issue No 106 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Go 跑 Python! golang, grumpy Grumpy is an experimental Python runtime for Go. It translates Python code into Go programs, and those transpiled programs run seamlessly within the Go runtime. We needed to support a large existing Python codebase, so it was important to have a high degree of compatibility with CPython (quirks and all). The goal is for Grumpy to be a drop-in replacement runtime for any pure-Python project. Curator’s note - If you are a Go Programming Language Developer do checkout http://importgolang.com/newsletter/ (是也乎: 玩具级,看爹了… ) 亲,2017 愿意升级到 Python 3.x 嘛? importpython Take the twitter poll, Do you see yourself using 3.x in 2017. (是也乎: 当前近6成的人原意升级,不过,真实来也得看项目是否允许了 ) Handling Unicode Strings in Python unicode I am a seasoned python developer, I have seen many UnicodeDecodeError myself, I have seen many new pythonista experience problems related to unicode strings. Actually understanding and handling text data in computer is never easy. Sometimes the programming language makes it even harder. In this post, I will try to explain everything about text and unicode handling in python. (是也乎: 简单的说用 Py3 …可是…唉;-( ) 5 things to watch in Python in 2017 An improved asyncio module, Pyjion for speed, and moving to Python 3 will make for a rich Python ecosystem. (是也乎: 又一个预言术…一切都在 py3 怎么赢得 google 的心了 ) 如何在 Linux 中安装 Scikit-Learn 来我开始机器学习的指南 machine learning In this Tutorial I will describe how you can get started with Machine Learning on Linux using Scikit-Learn and Python 3. 用 pbr 来作 Python 包管理 packaging A library for managing seatuptools packaging needs in a consistent manner. pbr reads and then filters the setup.cfg data through a setup hook to fill in default values and provide more sensible behaviors, and then feeds the results in as the arguments to a call to setup.py - so the heavy lifting of handling python packaging needs is still being done by setuptools. (是也乎: 什么年代了还是 ini 格式…也没有解决包的本地存储管理… ) BDFL 的启源 Guido This is an old article written by Guido van van Rossum himself. Occasionally people ask me about the origins of my nickname BDFL (Benevolent Dictator For Life). At some point, Wikipedia claimed it was from a Monty Python skit, which is patently false, although it has sometimes been called a Pythonesque title. I recently trawled through an old mailbox of mine, and found a message from 1995 that pinpoints the origin exactly. I’m including the entire message here, to end any doubts that the term originated in the Python community. (是也乎: 旧文有回甘… ) Armin 解说 Flask globals - Video flask, video This talk explores how you can build applications and APIs with Flask step by step by being easy to test and scale to larger and more complex scenarios. The talk will also go a bit into the history of some design decisions in Flask and what works well and in which areas you might want to mix it with other technologies for better results. 如何审查 Django ORM SQL 查询 ORM Copy-paste this into your Python 3 interpreter to see a human-readable version of the raw SQL queries that your Django code is running. DSF 宣布2016 Malcolm Tredinnick Memorial Prize 的获胜者 djangogirls Aisha (@AishaXBello) joined the Django community when she attended a Django Girls workshop during EuroPython in 2015. From that point on, Aisha’s trajectory in the Django world was unstoppable. She is not only a talented developer but her desire to keep learning and sharing her knowledge with others is simply inspiring. She organized or helped organize a huge number of Django Girls workshop in her home country of Nigeria. Thanks to her, Nigeria is on its way to be the world-record holder of most Django Girls events organized. (是也乎: 尼日利亚 的 ) Django 或 Flask - Reddit 讨论 flask (是也乎: 也属月经贴了…简单的说, 有銭就上 Django. ) 用NumPy进行通道检测 numpy, scipy Detect lanes on video frames, using NumPy and SciPy. My goal is not to achieve better performance or speed then with OpenCV. Rather, I’m going to implement some techniques learned at the Computer Vision course. (是也乎: OpenCV 也大量使用 Numpy ) Python 机器学习的副作用 machine learning 基于 IP 地址的天气预报 code snippet Jupyter + Pachyderm — 第1部分,探索和了解历史分析 jupyter 第 8 集: Armin Ronacher 谈 Flask,Python生态系统和Unicode podcast 用 Python 从头开始实现分类器令俺明白了什么? machine learning, classification Machine learning can be intimidating for a newcomer. The concept of a machine learning things alone is quite abstract. How does that work in practice ?. In order to demystify some of the magic behind machine learning algorithms, I decided to implement a simple machine learning algorithm from scratch. I will not be using a library such as scikit-learn which already has many algorithms implemented. Instead, I’ll be writing all of the code in order to have a working binary classifier algorithm. The goal of this exercise is to understand its inner workings. (是也乎: 这是理解目标对象的最精确学习方式, 再制丫的. ) 好物 ~ 包/模块/库/片段… ...
原文: Import Python Weekly Newsletter - Issue No 105 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 现代字典 ~ Raymond Hettinger : Python core-python, dict Python’s dictionaries are stunningly good. Over the years, many great ideas have combined together to produce the modern implementation in Python 3.6. This fun talk is given by Raymond Hettinger, the Python core developer responsible for the set implementation and who designed the compact-and-ordered dict implemented in CPython for Python 3.6 and in PyPy for Python 2.7. (是也乎: 事实证明一个贴心的数据类型可以增加很多语言的依赖, 但是,另外一个现实也证明了只有一种数据类型的开发语言一样可以很好的使用, 所以? 存乎一心了. ) 通过 SSH 远程运行 Python 3 ssh, click I ran into this situation today where I wanted to issue a few commands over ssh to a remote host as part of a Click command I’m building to do some ops automation here at REVSYS. It’s probably not perfect in terms of error handling, but it sure is simple!. (是也乎: 嗯哼,就是 Fabric3 的软广呗. ) 用 Python 介绍数据科学 - Univeristy of Michigan data science, mooc The course will also introduce data manipulation and cleaning techniques using the popular python pandas data science library and introduce the abstraction of the DataFrame as the central data structure for data analysis. The course will end with a statistics primer, showing how various statistical measures can be applied to pandas DataFrames. By the end of the course, students will be able to take tabular data, clean it, manipulate it, and run basic inferential statistical analyses. (是也乎: 就是 panda 呗… ) 用 Python 进行数据整理 In this post, I will summarize some tidying examples Wickham uses in his paper and I will demonstrate how to do so using the Python pandas library. (是也乎: 依然是 Panda 呢… ) 用 Python 查询和展示天气数据 data science Considering rich Python Ecosystem of tools, libraries, and frameworks for data crunching, I’d like to share a few examples how to plug Datahub API as a data source to your Python-based workflow. I’ll start with a simple example: how to turn Datahub API JSON output into Numpy arrays using Pandas framework. (是也乎: 针对 Datahub API 输出的 JSON ) 2017 放弃 Python 2 python3 Python 3.6.0 came out day before yesterday, and it was like a Christmas present for many of us. But in the midst of all the celebration, many of you were still asking if it is safe to drop Python 2 and move over to Python 3. There still seems to be a fear of missing out on useful third party libraries that lack Python 3 support. So in this post, I will try to settle this issue once and for all by presenting the relevant data. After you have seen all the data, you will be able to come to your own conclusion (I have already expressed my conclusion in the title). (是也乎: 目测嗯哼的… ) 从 Python 到 Numpy numpy There are already a fair number of books about Numpy (see Bibliography) and a legitimate question is to wonder if another book is really necessary. As you may have guessed by reading these lines, my personal answer is yes, mostly because I think there is room for a different approach concentrating on the migration from Python to Numpy through vectorization. (是也乎: 是一部完备的小书…CC 协议,还没有翻译为中文…. rougier/from-python-to-numpy: An open-access book on numpy vectorization techniques, Nicolas P. Rougier, 2017 rST 格式 ) 加速 Python 运行: 案例研究 performance 支持 PyKids 服务 community pykids is a voluntary effort to bring Python to elementary school (5th & 6th grades). At present I run AWS servers to support my venture. These servers are available for anyone to use. I run a monthly bill of about 20 USD to run this server. The money that you donate will go into support keeping these servers online. 为小白的 Python IDE IDE (是也乎: 乱说! 初学更加不应该用 IDE 了… ) 检查 Python 包依赖 dependency (是也乎: 可怕的 Dependencies of django ) 为毛 Python 不是俺的最爱 opinion (是也乎: Python 的目标从来不是最爱哪… ) 好物 ~ 包/模块/库/片段… ...