蠎加载 113

原文: Import Python Weekly Newsletter - Issue No 113 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Guido van Rossum 访谈 podcast, BDFL Talkpython interview with Guido van Rossum aka BDFL. (是也乎: 有字幕的, 基本上就是回忆了 ABC 时代的嗯哼… ) 几个 Python 3 决择 / 进化 的关键视图 core-python The people who introduced me to Python chose it because of the elegance of the language, and it’s aesthetic qualities. Would they choose it again, I wonder? Would I?. (是也乎: 是什么以及为什么的 Py3 def hello_world(name): print ‘Hello’, name –> @coroutine async def hello_world(name: str) -> str: await print(‘Hello {}’.format(yield from name)) 一定是太多 C++ 程序媛进入了 python 内核开发团队! ) 在 Python 中设计模块 - ebook book This book is for people with some experience in an object oriented programming language. This book will help you get better at module/class level design. Hopefully, it will teach you to identify good design from bad. 为工程师和科学家的 Python 视频 video Python material in data science, analysis, and modeling, and optimization. Here is the youtube video channel of the site https://www.youtube.com/user/APMonitorCom (是也乎: 各种实战领域在职工程师/科学家们的 Pythonic 折腾 ) 使用 Uber 的 Pyflame 和日志解决问题 debugging This time, it was different though. My distributed web crawler seemed to be slowing down over time. Adding more nodes only had a temporary performance boost; the overall crawling speed gradually declined afterwards. So simply put, it couldn’t scale. But why?. In this post, you’ll find out what techniques and tools I used to diagnose scaling issues - and to an extent, more general performance issues - in my Python-based web crawler. (是也乎: 火焰图…. OpenResty 内置了专用工具, 现在咱大蠎也有了… ) Python Packaging 简要指南 packaging Code reuse is a very common need. It saves you time for writing the same code multiple times, enables leveraging other smart people’s work to make new things happen. Even just for one project, it helps organize code in a modular way so you can maintain each part separately. When it comes to python, it means format your project so it can be easily packaged. This is a simple instruction on how to go from nothing to a package that you can proudly put it in your portfolio to be used by other people. (是也乎: 一切最终归向 pypi ,这样有问题哪… ) 闭包约束 closures Emacs 作为 Python IDE emacs Note - The video is old, but worth watching for emacs users. 一种用于肺癌检测的python解决方案 deep learning 使用 Python 查找损坏的图像 image processing 5种 Python 库轻松进入机​​器学习 machine learning PyWren, Tfdeploy, Luigi, Kubelib, PyTorch. Note - We used luigi at my previous workplace and it’s a solid library to custom pipelines for batch processing. In our case it was used to enforce database migrations. 类型跟踪对Python很有用 debugging Type Tracing - as a program runs you trace it and record the types of variables coming in and out of functions, and being assigned to variables. (是也乎: 嗯哼?! 真正靠谱的还是人 ) 使用 Python 对扫描文档进行数据挖掘 data mining I’ve written a Python package called pdftabextract https://github.com/WZBSocialScienceCenter/pdftabextract that contains several helpful functions for that task and I’m explaining how to use them in that blog post. 好物 ~ 包/模块/库/片段… ...

2017-02-26 · 3 min · 1116 words · ZoomQuiet

蠎加载 112

原文: Import Python Weekly Newsletter - Issue No 112 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 以 Python 介绍计算机科学和编程.MIT 视频系列 video Introduction to Computer Science and Programming in Python is intended for students with little or no programming experience. It aims to provide students with an understanding of the role computation can play in solving problems and to help students, regardless of their major, feel justifiably confident of their ability to write small programs that allow them to accomplish useful goals. The class uses the Python 3.5 programming language. (是也乎: 基于 py3.5 ) Python 代码仓库移入 GitHub core-python Python core developer Brett talks about the history the decision to move Python to GitHub (是也乎: 可怜的 Hg ) memoryview core python memoryview is a special type that can be used to work with data stored in other data-structures. (是也乎: 又一个全新数据类型 ) 又一个 Python-esque 类型系统: 鸭式静态类型 mypy I think the mypy static type checker is a fantastic initiative, and absolutely love it. My one complaint is that it relies a little too much on subclassing for determining compatibility. This post discusses nominal vs. structural subtyping, duck typing and how it relates to structural subtyping, subtyping in mypy, and using abstract base classes in lieu of a structural subtyping system. (是也乎: mypy 比 python 更快的 C++ 化ing… ) 无惧正则表达式 regex (是也乎: 的确, 如果每天都用 Vim 进行基于正则表达式的各种表达, 自然就嗯哼了 ) 在 Python 中使用 Apache Parquet 实现极高的并行 IO 性能 parquet, IO In this post, I show how Parquet can encode very large datasets in a small file footprint, and how we can achieve data throughput significantly exceeding disk IO bandwidth by exploiting parallelism (multithreading). (是也乎: 嗯哼,超越硬盘 IO 速度… 可是,现在不都在云端了? PK 的是内存速度了哪… ) 使用Scikit学习和Dask的两个简单的方法 sckit learn This post describes two simple ways to use Dask to parallelize Scikit-Learn operations either on a single computer or across a cluster. 对数学嗯哼的人来学习 AI — P4 — Tensors Illustrated (和喵!) tensorflow This the 4th part in the series. Kafka 入门 kafka Basically in this guide we will configure a basic Kafka instance in an Ubuntu environment & write a very very basic python producer & consumer. (是也乎: 卡夫卡 是西方现代派文学的宗师和探险者,表现主义大师,作品突出的是孤独感与恐惧感; 所以, 程序猿创建了 Kafka 工程来管理孤独的消息队列… ) 使用语音数据预测性别 machine learning, classification A beginner’s guide to implementing classification algorithms in Python Ergonomica shell Ergonomica is a Python-based console language, integrating modules such as os, shutil, and subprocess into a fast, easy-to use environment. It allows for functional programming tools and operations as well as data types that would otherwise require obscure grep or sed commands. (是也乎: 又一个使用纯Python 完成的 Shell 环境… ) 在 Google Compute Engine 中使用 Keras 进行深度学习 deep learning, keras Inception, a model developed by Google is a deep CNN. Against the ImageNet dataset (a common dataset for measuring image recognition performance) it performed top-5 error 3.47%. In this tutorial, you’ll use the pre-trained Inception model to provide predictions on images uploaded to a web server. Django Weekly Issue 26 django Django round up for this week. 好物 ~ 包/模块/库/片段… ...

2017-02-20 · 3 min · 1136 words · ZoomQuiet

蠎加载 111

原文: Import Python Weekly Newsletter - Issue No 111 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Sublime Text 3 和 Python - Kenneth Reitz sublime I decided to revisit my editor configuration the other night, and experimented with every possible editor I could think of / imagine. I heavily configured vim (neovim), PyCharm, Eclipse, Emacs (Spacemacs), VSCode, Atom, Textual, and more. I knew I was going to stay put with my choice of Sublime Text 3 (which I have been using for 5+ years), but it’s nice to have validation. (是也乎: 又一个心碎的故事,其实, 编辑器不好用, 只是因为我们成长的太快, 没有什么东西可以一直容纳我们所有的编程个性的… 所以,要不自己开发一个, UliEditor 就是这样来的, 要不个性化配置一个出来, 这就是 Vim/Emacs 成神成圣的原因 ) Think Python 第二版 - 免费下载 book This is the second edition of Think Python, which uses Python 3 is out. 如何使用 Python 和 Google Maps API 绘制自己的自行车/慢跑路线 Apart from being a data scientist, I also spend a lot of time on my bike. It is therefore no surprise that I am a huge fan of all kinds of wearable devices. Lots of the times though, I get quite frustrated with the data processing and data visualization software that major providers of wearable devices offer. That’s why I have been trying to take things to my own hands. Recently I have started to play around with plotting my bike route from Python using Google Maps API. My novice’s guide to all this follows in the post. 将 Vim 用成 Python IDE vim, editor I love vim and often use it to write Python code. Here are some useful plugins and tools for building a delightful vim python environment, escpecially for Vim8. (是也乎: TMUX 一直是 Vim 党的好朋友 ) Python 3.6 和性能 python3.6 Slides from Why Python 3.6 is faster than Python 3.5 talk. Also included a preview of new features of Python 3.6 (是也乎: 性能党的注意力果断从 py2 迁移到了 py3 ) 我们团队中的 3 种方式提高多系统构建速度. Sponsor How xMatters Uses Toolchains to Move Process Forward Python function 脑移植? core-python Did you know about __code__ ? (是也乎: def foo(): return “I’m foo!” def bar(): return “I’m bar!” foo.code = bar.code foo() 猜?! 最后输出什么!? ) K-Means和其他聚类算法:基于 Python 的快速入门 k-means, clustering 在 Python 中将 Postgres 数据作为 JSON 返回 postgres row_to_json and json_build_object usage along with code snippet for SQLAlchemy users. (是也乎: 可是,这本身不是 Pg 的一个特性嘛?! ) 在 Apache Spark 中用 UDF spark, user defined functions User-defined functions (UDFs) are a key feature of most SQL environments to extend the system’s built-in functionality. UDFs allow developers to enable new functions in higher level languages such as SQL by abstracting their lower level language implementations. Apache Spark is no exception, and offers a wide range of options for integrating UDFs with Spark SQL workflows. 在 Python 中进行 Encoding Categorical Values in Python datascience Many machine learning algorithms can support categorical values without further manipulation but there are many more algorithms that do not. Therefore, the analyst is faced with the challenge of figuring out how to turn these text attributes into numerical values for further processing. Python 的简单热门产品推荐引擎 machine learning, recommendation engine Pyweek Game Jam is 19th-26th February community, game development The Pyweek rules, in short, are Develop a game, In Python (mostly, at least!), As an individual or with a team, In exactly one week (or less!), From “scratch” - no personal codebases, only public, documented librarie, On a theme that is selected by vote, announced at the moment the contest starts. (是也乎: 用一周时间从0开始构建一个游戏的比赛 ) Seaborn 的 Python matplotlib, statistics Seaborn is a wrapper around Matplotlib that makes creating common statistical plots easy. The list of supported plots includes univariate and bivariate distribution plots, regression plots, and a number of methods for plotting categorical variables. The full list of plots Seaborn provides is in their API reference. 用 Amazon ML 对 Tweets 分类 aws, machine learning Python 新手经 humor 十小时 Python 解释器源代码通读 Python Video Series on CPython Internals. 使用 Python 在 Google 地球中打点 simplekml, kml First we need to import the library to create point in the Google Earth using simplekml module. 用 scikit-learn 的线性回归分析棋盘游戏数据 scikit-learn Doc2vec 简介 NLP, doc2vec Today I am going to demonstrate a simple implementation of nlp and doc2vec. The idea is to train doc2vec model from text document. I had about 20 text files to start with. Although the 20 document corpus seems small but the perk is it takes around 2 minutes to train the model. (是也乎: 比 perk 更加简洁以及高速的 NPL 模块 ) 好物 ~ 包/模块/库/片段… ...

2017-02-11 · 3 min · 1316 words · ZoomQuiet

蠎加载 110

原文: Import Python Weekly Newsletter - Issue No 110 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 支撑每秒百万请求 + Japronto implements a pretty solid feature set:HTTP 1.x implementation with support for chunked uploadsFull support for HTTP pipelining, Keep-alive connections with configurable reaper, Support for synchronous and asynchronous views, Master-multiworker model based on forking, Support for code reloading on changes, Simple routing. (是也乎: Japronto 出来的… ) Reuven Lerner: 设置 Jupyter 服务器的五分钟指南 jupyter Nearly every day, I teach a course in Python. And nearly every day, I thus use the Jupyter notebook: I do my live-coding demos in it, answer students’ questions using it, and also send it to my students at the end of the day, so that they can review my code without having to type furiously or take pictures of my screen. (是也乎: Jupyter 内置了… ) 使用 Django,Celery 和 rabbitMQ 构建异步任务 celery, rabbitmq In this post, I’ll be talking about setting up a distributed task processing system for doing asynchronous processing. As your website grows and handles lot of traffic, there naturally comes a need to ensure best performance for your users. While there are multiple things which need to be done to achieve that, one of the most important things is processing things in background. (是也乎: 这个组合,有点儿… ) 使用 Arduino 和 Python 构建简单的摆锤来测量运动 arduino We’ll build a classic and important physical system, the simple pendulum. We’ll use an Arduino and a potentiometer to measure the amplitude of the pendulum’s motion and Python to read and visualize our data. 什么是Flake8和为什么我们应该使用它?? linting There are a couple good python code linter tools you can use. The one I’ve recently discovered is a Flake8. Which is “the wrapper which verifies pep8, pyflakes and circular complexity “. It has low rate of false positives. (是也乎: 徦阳性少的 linter.. ) 用 Python 运动跟踪 motion tracking My daughter, Alex, was in the 6th grade this year. For her science fair project, Alex wanted to do something involving animals. I had read about an experiment where lab rats were recorded on video, and their motion was analyzed by a computer (to determine the effects of a neurotoxin). We owned 2 gerbils, Havoc and Zoom, so I suggested to Alex we do a similar experiment with the gerbils. For some reason, she didn’t want to test a neurotoxin on her pets, so instead she decided to test the effects of full spectrum lighting on their movement. (是也乎: 儿童行为心理学方面的嗯哼 ) 用 Pytest 测试 Python 应用 testing Pytest stands out among Python testing tools due to its ease of use. This tutorial will get you started with using pytest to test your next Python project. (是也乎: Pytest 已经成为标准了… ) 为什么要学习Python?这里有8个数据驱动的原因 core-python Is Python worth learning? We’ve interviewed experts and surveyed the job market to identify the key reasons why you should learn Python today. Python Excel 教程: 初级导引 excel Python 的黑客指南 - 作者访谈 book review 机器学习与 Jupyter 使用 Scala,Spark 和 Python:安装 jupyter, spark Google Python Style Guide style guide This guide has been there for a while, sharing it again. (是也乎: 这份文档,值得一读再读 ) 绘制IMDb平均评分 matplotlib In the previous post (Playing with IMDB, Python and Pandas), I tried to obtain the average IMDb rating of an actress. This time I’ll play with matplotlib in order to plot the evolution of an actress over the years. 在 Python 中处理ssh ssh Working with the remote servers is a common scenario for most of us. Sometimes, we do our actual work over those remote computers, sometimes our code does something for us in the remote systems. Even Vagrant instances on your laptop are also remote systems, you still have to ssh into those systems to get things done. (是也乎: 早已可以了… ) 使用 Docker,Python,Amazon SNS 和 SQS 构建实时事件驱动的访问日志系统 docker, aws, sns, sqs 简易构造符号链接 code snippet I never could remember how to use it, mixing the order of the parameters, and the man page did not help. So I thought, why not write a small wrapper around it? 好物 ~ 包/模块/库/片段… ...

2017-02-10 · 3 min · 1265 words · ZoomQuiet