蠎加载 138

原文: Import Python Weekly Newsletter - Issue No 138 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 单元测试和模块 unittest video In this Python Programming Tutorial, we will be learning how to unit-test our code using the unittest module. Unit testing will allow you to be more comfortable with refactoring and knowing whether or not your updates broke any of your existing code. Unit testing is a must on any large projects and is used by all major companies. Not only that, but it will greatly improve your personal code as well. Let’s get started. (是也乎: 叕一个 TDD 方面的嗯哼了… ) Python 线程 - Multithreading Playlist videos, multithreading 数据科学 Rosetta Stone: 分类 在 Python, R, MATLAB, SAS, 以及 Julia | Heaton Research data science 自动将 Python 2 代码翻译成 3 的 Python 3 This web is a online converter that reads Python 2.x source code and applies a series of fixers to transform it into valid Python 3.x code Enter your Python2 code on the left, hit the button, and boom, Python3 code on the right (是也乎: 可以嘛?敢用嘛? ) Python 队列死锁的悲伤故事 concurrency This is a story about how very difficult it is to build concurrent programs. It’s also a story about a bug in Python’s Queue class, a class which happens to be the easiest way to make concurrency simple in Python. This is not a happy story: this is a tragedy, a story of deadlocks and despair. 如何在 Python 领域成为专家? core-python Notebook based off James Powell’s talk at PyData 2017. (是也乎: 配合 youtube 的一则 ipynb 分享, metaclasses 开始… ) 仔细看看 Python f-strings 如何工作 f-strings F-strings provide a concise and convenient way to embed python expressions inside string literals for formatting. (是也乎: 针对 PEP 498 的嗯哼 ) 谁负责维护 PyPI 以及负责? pypi Reddit Discussion Hy 的小小一步 - 我的 lispy Python 经验 lisp Roughly, Hy is to Python as Clojure is to Java. Hy completely inter-ops with Python. I’ve hit commit 1,500 in my Hy project at work. I wanted to share my experience working with Hy, where I feel it shines and where it falls short. (是也乎: 等等-> Clojure LISP?! 叕一个为了 LISP 的方言, py 造… #! /usr/bin/env hy (print “I was going to code in Python syntax, but then I got Hy.”) 意思是可以用 Python 来学习 Scheme 了?! ) Python 和 Haskell 中的左右折叠->原始递归模式 haskell A “fold” is a fundamental primitive in defining operations on data structures; it’s particularly important in functional languages where recursion is the default tool to express repetition. In this article I’ll present how left and right folds work and how they map to some fundamental recursive patterns. The article starts with Python, which should be (or at least look) familiar to most programmers. It then switches to Haskell for a discussion of more advanced topics like the connection between folding and laziness, as well as monoids. (是也乎: 等等? Haskell ?! ) 用 Python 分析和测试 C c-code C is relatively difficult to write, making it harder to analyse and test. It would be helpful to be able to do this with a higher level language, such as Python. Analysis and testing don’t affect performance of the actual data structure, so using a slower but easier and more productive language for this seems reasonable. In this article, we walk though a simple example of doing this with a built-in Python library for interfacing with C called ctypes. 在 Python 中使用 GDAL / OGR 对地址进行地理编码和执行点多边形测试 geo This short post shows how to use Python packages googlemaps and GDAL. Debugging 在 Python debugging One of the reasons why I love the Python programming language is because of how easy debugging is. You don’t need a full blown IDE to be able to debug your Python application. We will go through the process of debugging a simple Python script using the pdb module from the Python standard library, which comes with most installation of Python. (是也乎: 叕一个 debug 的经验分享, 只是 print() 可以解决 99% 情况时,有什么新动力要用… ) 引入新的图像注释类型 - Python 代码片段 image processing We’re excited to be launching a bunch of new annotation types for images. Since the launch of our bounding box API, we’ve annotated millions of images with boxes to identify a host of different objects, from cars and hats to roof damage and parking lots. Scale is becoming an industry-standard tool for solving computer vision problems. 用 lehar 在终端展示数据 visualization The post is about a terminal visualization tool lehar that is open sourced at https://github.com/darxtrix/lehar (是也乎: Find commits by authors in a git repo $ git shortlog -s | cut -f1 | lehar ▇▁▁▁▁▁▁▂▃▁▁█▁▁▂▃▅▁▁▁▂▆▁▁▁▂▁▁▁▁▂▇▁▅▆▁▁▁▄▁▁█▁▁▂▁▂▁ 还有这种操作?! ) Select & Prefetch Related django Today the #DjangoTip will be about using select_related and prefetch_related to improve our queries performance. Note - Django developer do check out django newsletter - http://djangoweekly.com 好物 ~ 包/模块/库/片段… ...

2017-08-19 · 4 min · 1899 words · ZoomQuiet

蠎加载 137

原文: Import Python Weekly Newsletter - Issue No 137 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 怪癖 core-python Favorite #pythonoddity tweets by @treyhunner (是也乎: 叕一组高端黑技巧…其实,知道了, 也别用哪… ) Python 的 AI research - podcast podcast Today you’ll meet Alex Lavin, a Python developer and research scientist at Vicarious where they are trying to develop artificial general intelligence for robots. Python 装饰器正确的打开方式: 编程语言的4位观众 - Code Without Rules decorators If you’re a Python programmer, the following post will show you why decorators exist, and how to compensate for their limitations. Python 的机器学习搭车客指南 machine learning Featuring implementation code, instructional videos, and more Amazon S3 文件系统 Python 版 aws, s3 I’d like to announce an new Python module to make working with Amazon S3 files a whole lot easier. (是也乎: 叕一个 S3 的封装, 不过, 有人能嗯哼得过官方的任性嘛?! ) 在 Django 清晰的架构 django This post will try to explain our approach to apply Clean Architecture on a Django Restful API. It is useful to be familiarized with Django framework as well as with Uncle Bob’s Clean Architecture before keep reading. (是也乎: 好吧 –> Clean Architecture 是个专有功能… ) 两周用对 Pandas 技术 pandas 50行 Python 代码来预测股票 stock trading In this blog post we’re going to build a stock price predication graph using scimitar-learn in just 50 lines of Python. (是也乎: scimitar-learn 都封装好了 ) DjangoTip-> 玩转 Querysets django PSF 新闻 PSF The Ethical Maintainer: Community Service Award Recipient Glyph Lefkowitz. 从 Scratch 支持 Spotify 的 Sublime 插件 sublime plugin Part 1 - Series Introduction & Environment Setup. Pycon Australia 2017 Videos pycon 好物 ~ 包/模块/库/片段… ...

2017-08-12 · 3 min · 1387 words · ZoomQuiet

蠎加载 136

原文: Import Python Weekly Newsletter - Issue No 136 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 对 Python object 反向工程 python object I faced an interesting challenge at work the other day. I felt like sharing because it might save a few hours for others, or reveal some insights about the Python internals. Python 正则表达式 regular expression In this video series, we will be tackling Python Regular Expressions. The first few videos we will go over the basics, and then tackle some intermediate problems using Python Regular Expressions. (是也乎: 叕一个正则表达式的嗯哼…可见好东西永远掌握在少数人心中… ) 使用进程池加速您的Python数据处理脚本 process pool (是也乎: 问题在,数据处理首先得是可以切片并发的哪… ) 基于 机器学习 用 Python 开发牌照识别系统 machine learning In this tutorial, I’ll be taking you through the basics of developing a vehicle license plate recognition system using the concepts of machine learning with Python. (是也乎: 用的是 scikit-image ) Python init.py & modular Imports core-python, code snippets (是也乎: 又常用又破烦的事儿… ) Logging in Python logging logging beyond 101 (是也乎: ( ̄▽ ̄) 这是没个头儿的… ) 用 Sightengine 发觉名人 machine learning We will see in this article how to detect if an image contains celebrities with Sightengine. Sam 清洁 Citadel (GoT) 以10小时,用 Python video processing Curator’s Note - I am a big Game of Thrones fan so had to share this. As a fan of Game of Thrones, I couldn’t wait for it to return for a 7th season. Watching the season premier, I greatly enjoyed that iconic scene of Sam doing his chores at the Citadel. I enjoyed it so much that I wanted to see more of it… much more of it. In this post we’ll take the short video compilation of Sam cleaning the Citadel, we will split it to multiple sub clips and create a video of Sam cleaning the Citadel using a random mix of those sub clips. sinuous-violin - Numpy and SciPy numpy, scipy The aim of this short notebook is to show how to use NumPy and SciPy to play with spectral audio signal analysis (and synthesis). (是也乎: ipynb 可以播放音乐了 ) Pandas 分组和 Agg 函数解释 pandas Every once in a while it is useful to take a step back and look at pandas’ functions and see if there is a new or better way to do things. I was recently working on a problem and noticed that pandas had a Grouper function that I had never used before. I looked into how it can be used and it turns out it is useful for the type of summary analysis I tend to do on a frequent basis. Yosai 和 Darin Gordon – Episode 120 – Podcast podcast For any program that is used by more than one person you need a way to control identity and permissions. There are myriad solutions to that problem, but most of them are tied to a specific framework. Yosai is a flexible, general purpose framework for managing role-based access to your applications that has been decoupled from the underlying platform. This week the author of Yosai, Darin Gordon, joins us to talk about why he started it, his experience porting it from Java, and where he hopes to take it in the future. (是也乎: 介绍通用 ACL 框架 Yosai ) 使用 Cython 来保护 Python 代码库 cpython Recently, I worked on a Python project that required the whole codebase to be protected using Cython. Although protecting Python sources from reverse engineering seems like a futile task at first, cythonizing all the code leads to a reasonable amount of security (the binary is very difficult to disassemble, but it’s still possible to e.g. monkey patch parts of the program). This security comes with a price though - the primary use case for Cython is writing compiled extensions that can easily interface with Python code. Therefore, the support for non-trivial module/package structures is rather limited and we have to do some extra work to achieve the desired results. (是也乎: 同时还能立即获得速度的提升, 问题在迁移的成本… ) 控制 Python 异步蠕变 asyncio The complication arises when invoking awaitable functions. Doing so requires an async defined code block or coroutine. A non-issue except that if your caller has to be async, then you can’t call it either unless its caller is async. Which then forces its caller into an async block as well, and so on. This is “async creep”. (是也乎: 雪崩在异步场景中的兄弟… ) 神密的 Dynamic Programming algorithms Maybe you’ve heard about it in preparing for coding interviews. Maybe you’ve struggled through it in an algorithms course. Maybe you’re trying to learn how to code on your own, and were told somewhere along the way that it’s important to understand dynamic programming. Using dynamic programming (DP) to write algorithms is as essential as it is feared. 优化 Pandas 代码速度的初学指南 pandas 写个 a map-reduce 任务来嗯哼数百万个小文件 mrjob, mapreduce 使用 TensorFlow 检测伪钞 tensorflow Today, let’s use TensorFlow to build an artificial neural network that detects fake banknotes. Hacking 相似搜索,用 python project What would you do if you wanted to know which files are the most similar to a particular text-based file? For example to find a particular configuration file which has changed its filename and its contents. 好物 ~ 包/模块/库/片段… ...

2017-08-04 · 4 min · 1982 words · ZoomQuiet

蠎加载 135

原文: Import Python Weekly Newsletter - Issue No 135 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 中测试重构实际一例 refactoring This post contains a step-by-step example of a refactoring session guided by tests. When dealing with untested or legacy code refactoring is dangerous and tests can help us do it the right way, minimizing the amount of bugs we introduce, and possibly completely avoiding them. Refactoring is not easy. It requires a double effort to understand code that others wrote, or that we wrote in the past, and moving around parts of it, simplifying it, in one word improving it, is by no means something for the faint-hearted. Like programming, refactoring has its rules and best practices, but it can be described as a mixture of technique, intuition, experience, risk. 波士顿地铁用 Python 的性能分析 (Pandas, Numpy, MatplotLib 以及 Seaborn) data science Boston’s Massachusetts Bay Transit Authority (MBTA) operates the 4th busiest subway system in the U.S. The MBTA recently began publishing substantial amount of subway data through its public APIs. I performed five analysis. 高效管理 Python 与 Docker 的项目依赖关系 docker, dependency management There are many ways to handle Python app dependencies with Docker. Here is an overview of the most common ones – with a twist. 通过 Sklearn 实现监督学习算法 - 线性回归 supervised learning In this blog, we will see how we can implement Supervised Learning Algorithm. Linear Regression using SkLearn Library in Python. SkLearn or scikit-learn is one of the most widely used tools for Machine Learning and Data Analysis. It does all the computation allowing you to focus on increasing the efficiency and not on the calculation part of the Algorithm. TeachCraft minecraft Learn to program Python within a multiplayer world we all know and love, Minecraft! (是也乎: ) Quart flask, project Quart is a Python asyncio web microframework with the same API as Flask. Quart should provide a very minimal step to use Asyncio in a Flask app. (是也乎: 叕一个针对 Py3 特性的微型 web 框架 from quart import Quart app = Quart(name) @app.route(’/’) async def hello(): return ‘hello’ app.run() 忒象 Bottle 了… ) Github 贡献简历生成器 offtopic This project give you the ability to generate your Resume from your Github contributions. 关于 Python 的 Matplotlib 简介 matpoltlib Matplotlib is a Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. Matplotlib can be used in Python scripts and the jupyter notebook, web application servers, and four graphical user interface toolkits. 使用 Sklearn 的 Count / Hash / TDiF 矢量化器分类文档 machine learning, classification The Sklearn library provides several powerful tools that can be used to extract features from text. In this article, I will show you how easy it can be to classify documents based on their content using Sklearn. Cython 0.26 有咩新咯? cpython PyData 西雅图 2017 视频已经上传 pydata conference 采访 HTTP 提示的 Chang-Hung Liang open source An exploration of the people behind the projects. Each post is an exclusive interview with a member of the open source community. 如何使用转移学习创建图像分类引擎 image processing, tensorflow In this post, we are documenting how we used Google’s TensorFlow to build this image recognition engine. 在组织中分发私有 Python 包的简单方法 dependency management, packages, distribution (是也乎: –> wheelhouse ) 机器学习 NLP:使用scikit-learning,python和NLTK的文本分类 text classification 风格化 Bokeh Visualizations graph Bokeh is a Python interactive visualization library that targets modern web browsers for presentation. Its goal is to provide elegant, concise construction of novel graphics in the style of D3.js, and to extend this capability with high-performance interactivity over very large or streaming datasets. Bokeh can help anyone who would like to quickly and easily create interactive plots, dashboards, and data applications.. Bokeh’s styling is very nice by default. However, extending Bokeh with your own custom styles can add an impressive level of polish to your visualizations. 好物 ~ 包/模块/库/片段… ...

2017-07-28 · 3 min · 1122 words · ZoomQuiet