蠎加载 145

原文: Import Python Weekly Newsletter - Issue No 145 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 用 Python 和条件随机字段进行拉丁语分词 NLP In this article, a CRF (Conditional Random Field) will be trained to learn how to segment Latin text. Using only very basic features and easily accessible training data, we are going to achieve a segmentation accuracy of 98 %. Python 中的 K均值聚类 machine learning Clustering is a type of Unsupervised learning. This is very often used when you don’t have labeled data. K-Means Clustering is one of the popular clustering algorithm. The goal of this algorithm is to find groups(clusters) in the given data. In this post we will implement K-Means algorithm using Python from scratch. Lifelong Rubyist 使一些 Python 代码 5x 加速 performance n this post I’m going to look at a bit of Python code I optimized recently, and then compare the process of making this code faster to the process of how I make Ruby code faster. Alice 在 Python 项目中 core-python Python project structure and packaging can be intimidating, but, if you take it step by step, it doesn’t have to be. Look at other people’s code, particularly smaller, modular projects, break the work up into pieces, and work through it piece by piece, until you’re all the way down the rabbit hole. (是也乎: 项目代码/结构的腐化速度和项目的活跃度是直接关联的 ) WSGI 还未够班 — 第一部分 wsgi This is the first part of a multi-part series discussing the limitation of WSGI-based Python web applications and the ways to overcome these limitations. WSGI 还未够班 — 第二部分 wsgi In the first part of this series we discussed the problems and limitations which inheres within WSGI-based Python web applications. In this part we will discuss what concurrency is and what is an event driven architecture Go vs CPython: 并发和并行选项的可视化对决 concurrency, parallelism Using MPG diagrams to see the differences between Threading, Multiprocessing and Asyncio, the 3 official CPython options, and Go Runtime. (是也乎: 对 google/grumpy: Grumpy is a Python to Go source code transcompiler and runtime. 的强烈召唤.. ) 用 Python 评估风险和返回事件的概率 statistics, quant There are various situations where quants look at different scenarios of an event when making investment decisions. Running simulated scenarios is an invaluable tool for all finance/investment managers as it allows them to measure likely performance for various states. 监视,记录和提醒 Linux 上 CPU 的过载 code snippets I wrote a Python script (GitHub) that does a few things. First and foremost, I wanted to know every minute on the minute what my CPU core temps were regardless of whether I’m getting throttled or not so that I had the option to chart this (I haven’t done this, as I think I’ve found the culprit but I wanted to keep my options open). I also wanted to know if my laptop fan was functioning as desired in relation to the CPU temps, so I needed to grab fan RPM. (是也乎: Lenovo T420s 上运行的 Linux 中的自制监察脚本… tstringer/linux-core-temperature-monitor: Script (meant to run via cron) to monitor, log, and alert when the CPU is throttled due to overheating 可是 Glances 全部嗯哼了哪… ) 搞一个 BT Torrent 客户端:第1步 code snippets 介绍在 Python 中使用 NetworkX 进行图形优化 networkx This NetworkX tutorial will show you how to do graph optimization in Python by solving the Chinese Postman Problem in Python. (是也乎: 是的, 完备的了… ) 设计 Python 固定大小的散列图 core-python, dict implement a fixed-size hash map that associates string keys with arbitrary data object references. Flask-SocketIO flask Flask-SocketIO gives Flask applications access to low latency bi-directional communications between the clients and the server. The client-side application can use any of the SocketIO official clients libraries in Javascript, C++, Java and Swift, or any compatible client to establish a permanent connection to the server. Python Release Python 3.6.3 new release Python 3.6.3 is the third maintenance release of Python 3.6. The Python 3.6 series contains many new features and optimizations. See the What’s New In Python 3.6 document for more information. 用 Spark 交互分析 100GB 的 JSON 数据 spark Do you know what is the heaviest book ever printed? Let’s find out by exploring the Open Library data set using Spark in Python. (是也乎: 港真, 100G 现在只是小数据了… 关键是 Open Library 数据集的存在, 用来找最重的书? ) Parallel Processing in Python multiprocessing 好物 ~ 包/模块/库/片段… ...

2017-10-07 · 4 min · 1882 words · ZoomQuiet

蠎加载 144

原文: Import Python Weekly Newsletter - Issue No 144 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… NumPy 两个很酷的功能:通过切片和广播进行突变 numpy In this article, let us discuss briefly about two interesting features of NumPy viz. mutation by slicing and broadcasting. 用 Python 轻松实现微服务 microservices This small note portray process of creation a self-sufficient microservice. Test and Code: 31: I’m so sick of the testing pyramid podcast What started as a twitter disagreement carries over into this civil discussion of software testing. Brian and Paul discuss testing practices such as the testing pyramid, TDD, unit testing, system testing, and balancing test effort. 查找网页的创建或修改日期 text extraction htmldate provides a simple and convenient way to extract the creation or modification date of web pages, within Python or on the command-line. Based on HTML parsing and scraping functions: 用 Python 对 Docker 中的 Nginx 进行动态配置 docker, nginx Deploying nginx in a dynamic container environment takes a little work, especially if you don’t want to pay the big bucks for NGINX Plus. I wrote a low-tech python script for learning how things work under the hood; find it on my Github. There are open-source reverse-proxy solutions that are built specifically for container environments, like traefik. Traefik obviates the need for nginx altogether, but if you still want to run nginx, consider nginx-proxy. 通过构建一个区块链来学习之 blockchain The fastest way to learn how Blockchains work is to build one. Medium.com, 更多统计信息 - IBM沃森数据实验室 data science How I analyzed our Medium publication stats in a Python notebook? 使用Python和Flask构建简单的Restful Api第2部分 sqlite In this article I will show you how to build simple restful api with flask and SQLite that have capabilities to create, read, update, and delete data from database. (是也乎: 所有 RESTful 都是对应用的一种粗暴解释… 所以, xRPC 开始嗯哼 ) Apache Arrow 以及 “最恨 pandas 的10件事儿” - Wes McKinney pandas This post is the first of many to come on Apache Arrow, pandas, pandas2, and the general trajectory of my work in recent times and into the foreseeable future. This is a bit of a read and overall fairly technical, but if interested I encourage you to take the time to work through it. (是也乎: 恨晩了, 已经成标准了… ) EuroPython 大会视频 videos 在 Python 中模拟 IC electronics Most people who want to simulate logic ICs will use Verilog, VHDL, or System Verilog. Not [hsoft]. He wanted to use Python, and wrote a simple Python framework for doing just that. You can find the code on GitHub, and there is an ASCII video that won’t embed here at Hackaday, but which you can view at ASCIInema. (是也乎: 简单的说 终端的能力远没挖掘到底儿… ) USGS 数据集列出了美国的每个风力发电机组 data science, jypyter Jupyter Notebook (是也乎: 也就是说 用 ipynb 发论文不远了… ) Python 数据分析与 Pandas pandas, tutorial Python is a great language for data analysis. pandas is a Python package providing fast, flexible, and expressive data structures designed to make working with “relational” or “labeled” data both easy and intuitive. It aims to be the fundamental high-level building block for doing practical, real world data analysis in Python. In this post we’ll get to know more about doing data analysis using pandas. (是也乎: 叕一个 Pandas 教程, 其实就一句话, 别怕浪费内存… ) Python 覆盖测试可以很快 coverage SerpentAI: 游戏代理框架 game engine Serpent.AI is a simple yet powerful, novel framework to assist developers in the creation of game agents. Turn ANY video game you own into a sandbox environment ripe for experimentation, all with familiar Python code. The framework’s raison d’être is first and foremost to provide a valuable tool for Machine Learning & AI research. It also turns out to be ridiculously fun to use as a hobbyist (and dangerously addictive; a fair warning)! (是也乎: .io 之后 .ai 是又一个可屯域名了 ) Python: SQL 到 JSON 再超越! json, sql 使用 Django Rest 框架构建远程过程调用(RPC)端点 DRF, RPC The Django Rest Framework (DRF), has a lot of built in functionality that supports CRUD operations, but building an RPC endpoint requires hand-rolling much of that. Ultimately, if we’re adding an RPC endpoint to an existing API with mostly REST endpoints, we want to match the design of our new endpoint to match that of the DRF, so we need to understand what each piece does. (是也乎: 所以, Dj 也开始 *RPC 了, 世界总是在重复自己… ) 11 技巧以便在编码Python时保持安全 tips and tricks Twitter 时间线的情绪分析 twitter This post will show and explain how to build a simple tool for Sentiment Analysis of Twitter posts using Python and a few other libraries on top. Full code is available on GitHub. (是也乎: 简单的说, twitter 通过开放数据, 生将自己变成了数据科学地基 ) 用 Python 来 gRPC 简化指南 gRPC Google’s gRPC provides a framework for implementing RPC (Remote Procedure Call) workflows. By layering on top of HTTP/2 and using protocol buffers, gRPC promises a lot of benefits over conventional REST+JSON APIs. (是也乎: 参考: WEB开发中,使用JSON-RPC好,还是RESTful API好? - 知乎 ) A Django Rest App With Type Annotated Way type annotation Python Itertools 指南 itertools Those iterables are more powerful than you can possibly imagine. (是也乎: 其实, 这种工具在上古都是完备的,只是反直觉, 所以… ) 好物 ~ 包/模块/库/片段… ...

2017-09-30 · 4 min · 1973 words · ZoomQuiet

蠎加载 143

原文: Import Python Weekly Newsletter - Issue No 143 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 如何在一小时内建立书籍推荐系统第1部分 - 基础知识 machine learning Building recommender systems today requires specialized expertise in analytics, machine learning and software engineering, and learning new skills and tools is difficult and time-consuming. In this post, we will start from scratch, covering some basic fundamental techniques and implementations in Python. In the future posts, we will cover more sophisticated methods such as content-based filtering and collaborative based filtering. (是也乎: pandas->nb->k-Nearest->… Machine-Learning-with-Python/Recommender Systems - The Fundamentals.ipynb at master · susanli2016/Machine-Learning-with-Python 是的 jupyter 上直接撸的 ) 我们如何在一小时内建立书籍推荐系统第2部分 - k最近的邻居和矩阵… machine learning In the last post, we saw how we could use simple correlational techniques to create a measure of similarity between the books’ users based on their rating records. In this post, we will explain how you can use those same sort of similarity metrics to recommend books to a book’s readers. Python Gem #19: 查找表 > if chain core-python What should be a really simple function has turned into a fifty-line gargantuan that’s too hard to read properly because of the sheer number of lines. The culprit; a seriously long if-elsif-else chain. But not to fear; there’s a better way! 最饭的可怕错误消息<- Python core-python TypeError: object() takes no parameters ...

2017-09-22 · 5 min · 2376 words · ZoomQuiet

蠎加载 142

原文: Import Python Weekly Newsletter - Issue No 142 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 3.7 有什么新的? new release This article explains the new features in Python 3.7, compared to 3.6. (是也乎: 因为老爹没有公司任务了, 所以,开始发力社区版本? ) 如何用 Python 生成 FiveThirtyEight 图表? graph, FiveThirtyEight If you read data science articles, you may have already stumbled upon FiveThirtyEight’s content. Naturally, you were impressed by their awesome visualizations. You wanted to make your own awesome visualizations and so asked Quora and Reddit how to do it. You received some answers, but they were rather vague. You still can’t get the graphs done yourself. In this post, we’ll help you. Using Python’s matplotlib and pandas, we’ll see that it’s rather easy to replicate the core parts of any FiveThirtyEight (FTE) visualization. (是也乎: FiveThirtyEight 原来是家公司,因为精美的可视化作品, 而变成了专门的 FTE 风格… ) 在 Unix 环境中配置 Python (用 pyenv 以及 direnv) environment, pyenv This post is about how to set up multiple Python versions and environments on a development machine (and why I don’t use conda). 在 Docker 中用 Jupyter Notebook 跑 PySpark – Suci Lin – Medium docker, spark, jypyter It is much much easier to run PySpark with docker now, especially using an image from the repository of Jupyter. When you just want to try or learn Python. it is very convenient to use Jupyter Notebook for an interactive developing environment. The same reason makes me want to run Spark through PySpark in Jupyter Notenook. (是也乎: 嚓, 这热点组合的… ) Surgical 时间追踪在 Python performance How to profile your python code to improve performance? 用卷积去噪在基于内容的图像检索中使自动编码器 machine learning, image processing Content based image retrieval (CBIR) systems enable to find similar images to a query image among an image dataset. The most famous CBIR system is the search per image feature of Google search. This article is a keras tutorial that demonstrates how to create a CBIR system on MNIST dataset. Our CBIR system will be based on a convolutional denoising autoencoder. It is a class of unsupervised deep learning algorithms. (是也乎: 基于内容的图像搜索… ) itertools.count code snippets You need to iterate over an infinite series of numbers, breaking when a condition is met. 如何用 Python 监听 S&P 500 股票 scraping, codesnippets I thought it would be nice to show how one can leverage Python’s Pandas library to get stock ticker symbols from Wikipedia. Equality 和 Identity tweet (是也乎: Equality vs Identity: »> a = [“x”, “y”] »> b = a »> c = [“x”, “y”] »> a == b == c True »> a is b True »> a is c False 所以, 这个 推 关注时间长了就怀疑人生了… 不过, logo 很萌… ) ...

2017-09-16 · 4 min · 1972 words · ZoomQuiet