蠎加载 115

原文: Import Python Weekly Newsletter - Issue No 115 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Worthy Read Fire 介绍 - 能自动生成 CLI 的嗯哼 - By Google CLI Today we are pleased to announce the open-sourcing of Python Fire. Python Fire generates command line interfaces (CLIs) from any Python code. Simply call the Fire function in any Python program to automatically turn that program into a CLI. The library is available from pypi via pip install fire, and the source is available on GitHub. (是也乎: 文档在 google/python-fire: Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object. 已经快 5000 星了… ) 用 Python 3.6 类型提示编写更好软件 type annotations Type annotations are a precious tool (especially if used in combination with an advanced IDE like PyCharm) that allow us to: write clear and implicitly documented code, prevent us from invoking methods with wrong data types (ok, actually we can do whatever at runtime since Python is a dynamic language and type hints as the name suggests is just that: an hint) and get useful code suggestions and autocompletion. (是也乎: 简单的说, 追加各种 C++ 式的特性, 就是为了将 IDE 卖的更好… ) 简单机器学习模型5行 Python 代码 machine learning We will test a simple Linear Regression Model by passing it training data and expecting correct output for a new input. 用 Facebook 的 Prophet Library 预测网站流量 machine learning, forecasting I was very interested to see that Facebook recently open sourced a python and R library called prophet which seeks to automate the forecasting process in a more sophisticated but easily tune-able model. In this article, I’ll introduce prophet and show how to use it to predict the volume of traffic in the next year for Practical Business Python. To make this a little more interesting, I will post the prediction through the end of March so we can take a look at how accurate the forecast is. (是也乎: Py+R 的一个实用库,或是说 PaaS ) Generator 清理 generators What happens if you close the generator instead of throwing an exception? (是也乎: 生成器关闭后… ) 俺的经验: 基于长运行时 芹菜 发布的微服务 celery While Celery is well-maintained, it’s not easy to find examples of advanced patterns of real-world usage. Also it’s often been difficult to find solutions to issues that we’ve come across. So I want to share some of our experiences. (是也乎: 又一个重病芹菜依赖症团队的嗯哼… ) 知识 Bootstrapping mindmap A little offtopic but enjoyed reading it. Do check https://github.com/nikitavoloboev/research/ Python 中使用 ctypes 导入:解决溢出问题 ctypes 在Jupyter可重复的数据分析 jupyter 使用Python构建微服务 第一部分 microservices Nowadays it is a common practice to work in smaller applications, sharing the responsibility among many different services. I believe it is critical to have some standard tools between the teams working solving those problems. Note here is the link to Part II https://medium.com/@ssola/building-microservices-with-python-part-2-9f951199094a 用 Python 寻找免费食物 scraping Postmates regularly does promotions where they offer free food and waive the delivery fee for certain restaurants. I recently realized that I could make this simpler by creating something that would track the Postmates website and notify me of deals. 用 Python 解析维基百科全数据 XML 转储 xml, parsing Note - My college project 11 years back did the same thing using C++. Today if I were to attempt the same problem I might look at using mapreduce / spark. (是也乎: 作者用 C++ 作过, 现在用 py 来… ) Python Datetime 获取月范围 datetime HackerRank 二元搜索: 冰淇淋店 algorithms 好物 ~ 包/模块/库/片段… ...

2017-03-14 · 3 min · 1107 words · ZoomQuiet

蠎加载 114

原文: Import Python Weekly Newsletter - Issue No 114 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… QueueLogger 和 Python JSON Logger logging Logging from multiple processes. 从文本中提取特征 machine learning This is my first time writing blog post about anything Python related. I go over the differences and how to use CountVectorizer() and TfidfVectorizer() from sci-kit learn. I’d love to hear what you think. (是也乎: 笔者说是第一篇 py 相关的嗯哼… ) Python 周聊: Emoji: Revisited video, emoji Special guest Katie McLaughlin will answer your questions about emoji: unicode, compatibility, support, and more. 深层和层次隐式模型 tensorflow As a practical example, we show how you can take any standard neural network and turn it into a deep implicit model: simply inject noise into the hidden layers. The hidden units in these layers are now interpreted as latent variables. Further, the induced latent variables are astonishingly flexible, going beyond Gaussians (or exponential families (Ranganath, Tang, Charlin, & Blei, 2015)) to arbitrary probability distributions. Deep generative modeling could not be any simpler! (是也乎: 简单的说 tensorflow 都支持的 ) Pythonistas 想要的定制杯子/配件 merchandise Cool Coffee Mugs for Python Developers. Check it out. (是也乎: ) Postmodern Error Handling 在 Python 3.6 python3, error handling How to catch some TYPES of errors before they happen. (是也乎: 后现代错误处理…눈_눈 ) Pandas 和 Jeff Reback – Episode 98 podcast 使用Google幻灯片API添加文字和图形 - G 套件开发秀 video Using Python API (是也乎: 油管上的…当然的. 由陈姓大叔讲解… ) Ned Batchelder: A tale of two exceptions, continued exception handling How to Rotate Images in Python Using a Horizon Detection Algorithm image processing (是也乎: 每个月5000张免费使用…无法用在视频上哪… ) Staffjoy 刚刚开源了 open source Staffjoy is shutting down, so we are open-sourcing our code. This version of our V1, intended for on-demand companies and call centers, has been heavily modified so that Staffjoy customers may continue using the software. Prophet: 规模化预报 machine learning Prophet is a procedure for forecasting time series data. It is based on an additive model where non-linear trends are fit with yearly and weekly seasonality, plus holidays. It works best with daily periodicity data with at least one year of historical data. Prophet is robust to missing data, shifts in the trend, and large outliers. (是也乎: 基于时间序列的预警 ) 一致性哈希环的简单解释 hash Consistent hash rings are beautiful structures, yet often poorly explained. Implementations tend to focus on clever language-specific tricks, and theoretical approaches insist on befuddling it with math and tangents irrelevant. (是也乎: 别的不说, 这图作的美… ) Async HTTP 在 PyPy3 上的基准测试 pypy PythonBuddy editor Python Editor With Live Syntax Checking and Execution (是也乎: 丑… ) 好物 ~ 包/模块/库/片段… ...

2017-03-03 · 2 min · 938 words · ZoomQuiet

蠎加载 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