蠎加载 106

原文: 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. (是也乎: 这是理解目标对象的最精确学习方式, 再制丫的. ) 好物 ~ 包/模块/库/片段… ...

2017-01-05 · 3 min · 1351 words · ZoomQuiet

蠎加载 105

原文: 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 的目标从来不是最爱哪… ) 好物 ~ 包/模块/库/片段… ...

2016-12-30 · 3 min · 1361 words · ZoomQuiet

蠎加载 104

原文: 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++ 那基本上是嗯哼的 ) 好物 ~ 包/模块/库/片段… ...

2016-12-23 · 3 min · 1308 words · ZoomQuiet

蠎加载 103

原文: 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. (是也乎: 越来越关心具体的测试序列对应的覆盖行区块了… ) 好物 ~ 包/模块/库/片段… ...

2016-12-15 · 3 min · 1195 words · ZoomQuiet