深入理解Python字符编码
不论你是有着多年经验的 python 老司机还是刚入门 Python 不久,你一定遇到过UnicodeEncodeError、UnicodeDecodeError 错误,每当遇到错误我们就拿着 encode、decode 函数翻来覆去的转换,有时试着试着问题就解决了,有时候怎么试都没辙,只有借用 Google...
View ArticlePyCharm Now Supports Pipenv
There's an update to PyCharm which includes support for Pipenv environments, and has better pytest support. PyCharm is JetBrains' integrated development environment for python. It provides a graphical...
View ArticleDictionaries in Python
python provides another composite data type called a dictionary , which is similar to a list in that it is a collection of objects. Here’s what you’ll learn in this tutorial:You’ll cover the basic...
View ArticlePython: I do not understand what happens with this generator
I'm curious as to what's happening here. Can someone who knows generators and coroutines well explain this code. def b(): for i in range(5): yield i x = (yield) print(x) def a(): g = b() next(g) for i...
View ArticlePython中10个必读的PEP提案
什么是PEP PEP 是 python 增强提案(Python Enhancement Proposal)的缩写。社区通过PEP来给 Python 语言建言献策,每个版本你所看到的新特性和一些变化都是通过PEP提案经过社区决策层讨论、投票决议,最终才有我们看到的功能。 0、PEP8...
View ArticleFaust, a Python-Based Distributed Stream-Processing Library
Robinhood , a free trading platform for stocks and cryptocurrency,has open-sourced its python-based stream processing library Faust . Faust is a Python 3 library available on GitHub , and takes...
View ArticleBash guide, Linux terminal tricks, DevOps mistakes, Python, awk, NASA, and more
We've rounded up our most popular articles from last week. And, in case you missed it, check out our Top 10 July must-reads: Killer tools and practical guides for admins, Skype alternatives, Slackware...
View ArticleOptimize code generated by sympy
Using SymPy to find a derivative (see this question: https://math.stackexchange.com/questions/726104/apply-chain-rule-to-vector-function-with-chained-dot-and-cross-product ), I came up with this code:...
View ArticleFirst step in Data Science with Python ― NumPy
I’ve read that the best way to learn something is to blog about it. Since I’ve been learning data science for some time now, I thought why not give it a try. So, here it is; my first ever blog post....
View ArticleDocker Container and Vagrant / Virtualbox 101s
Some simple recipes for getting started with running some demo virtual applications in variety of ways. Docker and Zeit Now flaskdemo This first demo creates a simple flask app and a Dockerfile with...
View ArticlePython On Raspberry Pi - Part 7
In the previous article, ‘ Raspberry PI: laying out the basics I ’ we mentioned the Raspberry PI as a low-cost computing device that was initially created to help students improve their programming...
View ArticleAchievement Unlocked: Certified in Artificial Intelligence
Frequent readers of this blog may recall last year I earned a certificate in Data Science through the Microsoft Academy and edX. I followed up with a certificate in Big Data earlier this year. Today I...
View ArticlePython 中如何修复微信支付漏洞
微信支付爆出安全漏洞,详见 http://www.techweb.com.cn/digitallife/2018-07-04/2682206.shtml,具体原理是微信支付的回调是 xml,这个漏洞的就是利用 xml 可以自定义文档结构来调用外部实体的能力来注入不安全信息,漏洞全称是 XML External Entity Injection ,简称...
View Article每日一博 | Python 那些容易被忽略的实用功能和特点
糖宝lsh的个人空间 python文章 正文 使用Python这么多年,才发现Python还有这些实用的功能和特点 原 荐 糖宝lsh 发布于 昨天 13:20 字数 1050 阅读 383 收藏 5 点赞 1 评论 0 Python 十年阿里,就只剩下这套Java开发体系了 >>>...
View ArticleTIOBE 8 月编程语言榜:Python 差点拿下第 3 名
需要注意的是,SQL自 2018 年 2 月起被重新添加到了 TIOBE 排行榜中,由于没有以往的数据可以对比,所以会给人 SQL 语言指数突然暴涨的错觉。 看了一下过去几个月的数据,从 5 月份开始反弹后,6、7 月 python 的数据在一路高涨,趋势不可挡。 Python 最初是 Perl...
View ArticlePython学习之路35-协程
《流畅的python》笔记。 本篇主要讨论一个与生成器看似无关,但实际非常相关的概念:协程。 1. 前言 说到协程(Coroutine),如果是刚接触Python不久的新手,估计第一个反应是:懵逼,这是个什么玩意儿?有一点基础的小伙伴可能会想到进程和线程。 其实, 和子程序(或者说函数)一样,协程也是一种程序组件 。Donald Knuth曾经说过, 子程序是协程的特例...
View Article让代码和迈克杰克逊一起跳舞
“ 阅读文本大概需要 3 分钟 还记得读高中时,有一次和同学一次去网吧上网,他让我看一个视频,是 Michael Jackson 的前倾 45° 的动作,当时觉得舞蹈还可以这样跳,太炫酷了。那时在网吧看了 2 小时 MJ 的舞蹈。此后就迷上了 MJ,迷上了他的太空步,迷上了他的机械舞,迷上了他的超强节奏律动的歌曲,成为了小小的...
View ArticlePython实现一条基于POS算法的区块链
在比特币公链架构解析中,就曾提到过为了实现去中介化的设计,比特币设计了一套共识协议,并通过此协议来保证系统的稳定性和防攻击性。 并且我们知道,截止目前使用最广泛,也是最被大家接受的共识算法,是我们先前介绍过的POW(proof of work)工作量证明算法。目前市值排名前二的比特币和以太坊也是采用的此算法。 虽然POW共识算法取得了巨大的成功,但对它的质疑也从来未曾停止过。...
View ArticleTag Image Endpoint Enhancements
The PixLab team is pleased to announce major enhancement to the /tagimg endpoint. The image labeling endpoint let you programmatically generates a description of an image in human readable language...
View ArticleMatthew Rocklin: Building SAGA optimization for Dask arrays
This work is supported by ETH Zurich , Anaconda Inc , and the Berkeley Institute for Data Science At a recent Scikit-learn/Scikit-image/Dask sprint at BIDS, Fabian Pedregosa (a machine learning...
View Article