蠎加载 146

原文: Import Python Weekly Newsletter - Issue No 146 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 通过在 python 中编 C 扩展来提高性能 cpython Interpreted language will never match the performance of compiled languages . Ever since I moved on to python from C/C++ , I always wanted to combine best of both worlds by extending python in C . (是也乎: 这事儿地球人都知道, M$ 还嫌 C 性能差在 C++ 代码中嵌汇编呢… 问题是, 首先功能稳定后, 还得找到性能瓶颈再针对性替代, 光这个工程就不简单了… ) 简介用 Pandas 进行数据清洗 pandas, excel I’ve been using Excel for data cleaning until I discovered how powerful pandas are for data analysis and data cleaning. In this article I want to go over basics of how to use pandas for cleaning data in excel files. (是也乎: 数据源是 excel 文件…细思恐极了.. ) 从零开始在 Python 中实施 Fisher 的 LDA machine learning, LDA Fisher’s Linear Discriminant Analysis (LDA) is a dimension reduction technique that can be used for classification as well. In this blog post, we will learn more about Fisher’s LDA and implement it from scratch in Python. Implementing Ethereum trading front-runs on the Bancor exchange in Python cryptocurrency This post is a deep-dive into programmatically trading on the Ethereum / Bancor exchange and exploiting a game-theoretic security flaw in Bancor, a high-profile smart contract on the Ethereum blockchain. Python 方法解析顺序 core-python, MRO In Python, a class can inherit features and attributes from multiple classes and thus, implements multiple inheritance. MRO or Method Resolution Order is the hierarchy in which base classes are searched when looking for a method in the parent class. 怎么用 Python 发布 HTTP/2 HTTP2 The simplest way to serve HTTP/2 is to use the Quart framework, furthermore Quart is the only Python framework to support server-push. 如何用 Python 搞出快速随机子集抽样 machine learning Imagine that you are developing a machine learning model to classify articles. You have managed to get an unreasonably large text file which contains millions of identifiers of similar articles that belong to the same class. You are unsure whether identifiers that are close to each other are independent. 迭代器和可迭代 - Agiliq Blog core-python 如何用 Python 在 Medium 中找到有趣的人来追踪 scraping, codesnippets Medium has a large amount of content, a large number of users, and an almost overwhelming number of posts. When you try to find interesting users to interact with, you’re flooded with visual noise. I define an interesting user as someone who is from your network, who is active, and who writes responses that are generally appreciated by the Medium community. (是也乎: 可惜, Medium 第一时间和谐掉了… ) 深度数学机器学习 learning.ai machine learning, math (是也乎: 简单的说 .ai 的好域名已经抢光了.. ) Explained using Python code snippets. livepython - 实时跟踪运行时 Python 代码 tracing code execution Watch your Python run like a movie. (是也乎: 象看电影一样观察你的python 代码的运行… 好吧, 对新手很重要… ) Facebook 中 Python 版本的状态 tweet K均值聚类 在 Python 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. 8 best languages to blog about web crawling (是也乎: 叕一则 github 公开数据的嗯哼 ) 好物 ~ 包/模块/库/片段… ...

2017-10-13 · 4 min · 1747 words · ZoomQuiet

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