蠎加载 173

原文: Import Python Weekly Newsletter - Issue No 173 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 集合理论与实践: Grok Pythonic收集类型 core-python, set Sets and logic are strongly related. That’s why proper use of set operations can eliminate lots of nested loops and ifs, producing code that is more readable and faster. Let’s talk about using sets in practice, and learn great API design ideas from Python’s set types. Luciano covered: - Python collection types - Theory and algebraic logic behind set-less and set types - Python protocols and operations for collections - Code examples for implementations of kinds of sets (是也乎: 善用 set 可以有效减少不必要的 循环和 if 判定 ) Pyre: Python 的快速类型检查 ...

2018-05-14 · 5 min · 2050 words · ZoomQuiet

蠎加载 172

原文: Import Python Weekly Newsletter - Issue No 172 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… TensorFlow Dev Summit 2018 TensorFlow, google Join the TensorFlow team as they kick off the 2018 TensorFlow Dev Summit! The TensorFlow Dev Summit brings together a diverse mix of machine learning users from around the world for a full day of highly technical talks, demos, and conversations with the TensorFlow team and community. 如何使用 Python 中 textblob 分类器自动分配 Jira Issue? text classification I’ve used Python’s textblob classifier to simply classify issues according to assignees from their description and headers. Classified issues used to classify newly created issues and results are recorded to a database. 2019 issues used as training set and %82 assignment accuracy have been achieved. As the training set grows bigger accuracy could be better. (是也乎: 嗯哼,目测只有在客服 Issue 方向有用… ) 基本 Python 面试题和答案 interview questions (是也乎: 叕一辑 FAQ.py, 应聘专用 ) Python 开发者画像: 用什么 作什么 survey A survey of 9,500 developers shows what Python programmers use and what they work on. See how typical you are as a Python developer (是也乎: 等等吧, 所以, Py2 即便官方不维护, 也不影响其广泛的使用… ) 最佳免费 Python 可视化包 visualization Nice curated list. (是也乎: 可视化的方向一定是专业化, 通用的, 考虑到输出, 推荐 Bokeh; 考虑日常推荐: pandas 呃, 其实用的就是: matplotlib ) 在 Python 中回归一个比例 statistics I frequently predict proportions (e.g., proportion of year during which a customer is active). This is a regression task because the dependent variables is a float, but the dependent variable is bound between the 0 and 1. Googling around, I had a hard time finding the a good way to model this situation, so I’ve written here what I think is the most straight forward solution. (是也乎: 数据归一化的常见招术式: from sklearn.datasets import make_regression ) 用 Python 对非数字数据进行聚类 numeric_data Clustering data is the process of grouping items so that items in a group (cluster) are similar and items in different groups are dissimilar. After data has been clustered, the results can be analyzed to see if any useful patterns emerge. For example, clustered sales data could reveal which items are often purchased together (famously, beer and diapers). 主题建模评估: 主题一致性 topic modeling In this article, we will go through the evaluation of Topic Modelling by introducing the concept of Topic coherence, as topic models give no guaranty on the interpretability of their output. Topic modeling provides us with methods to organize, understand and summarize large collections of textual information. There are many techniques that are used to obtain topic models. Latent Dirichlet Allocation (LDA) is a widely used topic modeling technique to extract topic from the textual data. Announcing PyTorch 1.0 for both research and production pytorch PyTorch 1.0 takes the modular, production-oriented capabilities from Caffe2 and ONNX and combines them with PyTorch’s existing flexible, research-focused design to provide a fast, seamless path from research prototyping to production deployment for a broad range of AI projects. (是也乎: 江湖传说:to be politically correct at Google import torch as tf ) 用 Python 基于 Google 位置记录分析通勤情况 | nvbn blog visualization, location, commute Since I moved to Amsterdam I’m biking to work almost every morning. And as Google is always tracking the location of my phone, I thought that it might be interesting to do something with that data. (是也乎: 反正都被追踪了, 那么除了 google 自动分析 我们自己也应该可以… ) PostgreSQL: 跨函数调用共享数据 postgres Recently I did some PostgreSQL consulting in the Berlin area (Germany) when I stumbled over an interesting request: How can data be shared across function calls in PostgreSQL? I recalled some one of the other features of PostgreSQL (15+ years old or so) to solve the issue. Here is how it works. (是也乎: OpenResty 从一开始就内置了一个对象数据库来解决跨请求的数据共享/操作… ) 正态性测试 testing, data science So you have a dataset and you’re about to run some test on it but first, you need to check for normality. Think about this question, “Given my data … if there is a deviation from normality, will there be a material impact my results?” (是也乎: 被测试数据对象集本身的正常状态检测 ) 从 subscene.com 批量下载字幕 – Scribbleghost project Ever just wanted to download a bunch of subtitles to check which one fits the video? Subscene got everything, but it can be tedious to download subtitles one by one. 前沿效益: 用 scipy 优化投资组合分配 scipy Given 4 assets’ risk and return as following, what could be the risk-return for any portfolio built with the assets. One may think that all possible values should fall inside the area. But it is possible to go beyond the bond, because combining inversely correlated assets can construct a portfolio with lower risk. Python/networkx 图形魔术 networkx Basic graph representation function on top of networkx graph library. (是也乎: networkx 是对 Graphviz 的 Pythonic 封装, 基于 dot 等工具的稳定, 可以尽情折腾… ) 使用 Python 和 Apache Spark 的阅读计划建议 spark, recommendation My goal in this post is simply to share how we at YouVersion are leveraging machine learning tools to generate product recommendations. 好物 ~ 包/模块/库/片段… ...

2018-05-07 · 5 min · 2227 words · ZoomQuiet

蠎加载 171

原文: Import Python Weekly Newsletter - Issue No 171 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 最好的 Python:从2017年到2018年收藏的一系列文章(到目前为止) 2017, python articles In this article, I’d like to share with you the articles I found most interesting and insightful (inspiring) last year and this year (so far). My other goal was to create a comprehensive list of the most valuable pieces for my Python students. (是也乎: 老司机的私人体验, 应该就是 Py 自身真正的好物了… ) Python 3.7: 介绍数据类 pycharm, data classes Python 3.7 is set to be released this summer, let’s have a sneak peek at some of the new features! If you’d like to play along at home with PyCharm, make sure you get PyCharm 2018.1 (or later if you’re reading this from the future). There are many new things in Python 3.7: various character set improvements, postponed evaluation of annotations, and more. One of the most exciting new features is support for the dataclass decorator. (是也乎: 怀疑哪, Py3 这么多激荡的变化, 是否有 IDE 厂商的嗯哼? ) Qt 让 Python 令计算贴近你 - Qt Blog pyside PySide2 – the bindings from Python to Qt – changes skin this spring. We have re-branded it as Qt for Python on a solution level, as we wanted the name to reflect the use of Qt in Python applications. Under the hood it is still PySide2 – just better. (是也乎: Qt 开源后走的一直不错, 只是太慢, 就连 IDE 都一直非常不嗯哼…这种广告都没有 subl 来的多…可想… ) 转换 Python ASTs 来优化 AST tl;dr Python comprehensions can have duplicate function calls (e.g. [foo(x) for x in … if foo(x)]). If these function calls are expensive, we need to rewrite our comprehensions to avoid the cost of calling them multiple times. In this post, we solve this by writing a decorator that converts a function in to AST, optimizes away duplicate function calls and compiles it at runtime in ~200 lines of code. (是也乎: 不过,这种机械优化, 永远没有人工介入后, 经验加成的效果好… ) Cgo 和 Python go, cpython If you look at the new Datadog Agent, you might notice most of the codebase is written in Go, although the checks we use to gather metrics are still written in Python. This is possible because the Datadog Agent, a regular Go binary, embeds a CPython interpreter that can be called whenever it needs to execute Python code. This process can be made transparent using an abstraction layer so that you can still write idiomatic Go code even when there’s Python running under the hood. (是也乎: 通过 C , go 和 python 一直灵魂相通的… ) 用 Python 进行机器学习的一些基本技巧和窍门 machine learning We describe some essential hacks and tricks for practicing machine learning with Python. 在 Kubernetes 中部署深度学习 GPU 运算模型 deep learning, GPU In this tutorial, we provide step-by-step instructions to go from loading a pre-trained Convolutional Neural Network model to creating a containerized web application that is hosted on Kubernetes cluster with GPUs on Azure Container Service (AKS). AKS makes it quick and easy to deploy and manage containerized applications without much expertise in managing Kubernetes environment. It eliminates complexity and operational overhead of maintaining the cluster by provisioning, upgrading, and scaling resources on demand, without taking the applications offline. AKS reduces the cost and complexity of using a Kubernetes cluster by managing the master nodes for which the user does no incur a cost. (是也乎: 这类工具一定会越来越方便的, 问题在 GPU 本身是硬件, 有固定成本, 这就是门槛了… ) Python 3 cheatsheet cheatsheet (是也乎: 叕一则作弊条…但是, 最靠谱的还是多用… ) Python 3 到 ES6 Javascript 转译器 js (是也乎: 没毛病, 问题只是, 这种转换的使用场景在哪儿? ) 用 PySpark 进行单元测试 – CambridgeSpark testing I don’t particularly enjoy writing tests, but having a proper testing suite is one of the fundamental building blocks that differentiate hacking from software engineering. Sort of like sending your application to the gym, if you do it right, it might not be a pleasant experience, but you’ll reap the benefits continuously. At work we are especially big fans of the testing pyramid, and having dozens of unit tests give us the support that we need to deliver high quality software with rapid delivery to production. (是也乎: 叕一个单元测试框架, ) 好物 ~ 包/模块/库/片段… ...

2018-04-22 · 4 min · 1979 words · ZoomQuiet

蠎加载 170

原文: Import Python Weekly Newsletter - Issue No 170 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Slicker: 用 Python 来移动东西的工具 | Khan Academy Engineering slicker Craig talked last post about our project to reorganize our whole Python codebase. This entails a lot of architectural challenges – deciding where to put each file, prioritizing which files and classes to split, and so on – which Carter will talk about more in the final post of this series. Today, I want to set all that aside to focus on the more mechanical process of moving: what does it take to move thousands of files, classes, and functions, each of which may be referenced by dozens or hundreds of others? We ended up writing a tool called Slicker to do it all, and the remainder of this post talks about why we needed it and how it works. (是也乎: 针对移动大量文件这一基础命题, 可汗学院嗯哼出了一大套课程… ) 嫑写 Idiomatic Python idiomatic python Write Understandable Code. There are two sides to every story :) (是也乎: 传统-反传统-约定-反约定… 好象 蠎之 Zen 中就说了相关决策原则… ) 用 Brexit 在 Python 中分析 Tweets 情感 sentimentanalysis Sentiment analysis is a method of analyzing a piece of text and deciding whether the writing is positive, negative or neutral. It is commonly used to understand how people feel about a topic. 不仅是 Python 的另一个 YOLO V3 image processing If you are interested on Computer Vision, then you have probably heard about YOLO by now. YOLO?—?“You Only Look Once” is a fast, real-time technique for object detection. (是也乎: YOLO — “You Only Look Once” 只用看一眼 ~ 物件识别模块名称, 起名学功力很够 ;-) 全新实现的: madhawav/YOLO3-4-Py: A Python wrapper on Darknet. Compatible with YOLO V3. 基本上就是大规模人流监控的基本模块了… ) Python 的多线程 multithreading This blog post is about Processes, Threads, and the GIL in Python. Because of the way that the Python GIL operates, it may be different than one initially expects, so this blog post is an attempt to discuss this in more detail. 通过 Python 了解区块链 blockchain About two weeks ago I realized why I had such an animosity towards bitcoin: I didn’t own any and I didn’t understand it. I decided to start learning about bitcoin through researching the technology behind it, aka block chain. I learned through creating a python script that builds a block chain, so I thought I would share it with others who would like to learn more about block chain. To clarify, while I was inspired by bitcoin, this post is focused on block chain. (是也乎: 其实: 区块链随想录——一种设想中的公链架构 - 简书 ) 成千上万错误配置的 Django 应用泄露敏感数据 django, debugmode The security researcher Fábio Castro discovered tens of thousands of Django apps that expose sensitive data because developers forget to disable the debug mode. (是也乎: PHP/MySQL/MongoDB/… 现在终于到了 Django, 凡是大规模嗯哼的, 必定基于默认配置暴露各种嗯哼… ) Nathaniel’s Python 从 Go 中学到的经验教训 golang Go is cool. Python type annotations with mypy are cool. Go has influenced how I write Python. (是也乎: Gopher 和 Pythonista 一直是水乳交融的 ) gopro-py-api: 非官方 Python 版 GoPro API库 gopro Unofficial GoPro API Library for Python - connect to GoPro cameras via WiFi. (是也乎: 叕一例硬件的非官方操控接口, 可想硬件的安全能力实在… ) 数据分析: Pandas 和 SQL 教俺平均值 | Opensource.com pandas Why data analysts should exercise caution when taking averages. 用高级 TensorFlow API 进行文本分类 tensorflow In this blog post we share our experience, in considerable detail, with using some of the high-level TensorFlow frameworks for a client’s text classification project. These include the Estimator framework and feature columns. (是也乎: 目测, 所谓高级都是从 Google 一生产线退役的旧功能组件 ) 好物 ~ 包/模块/库/片段… ...

2018-04-08 · 4 min · 1544 words · ZoomQuiet