蠎加载 135

原文: Import Python Weekly Newsletter - Issue No 135 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 中测试重构实际一例 refactoring This post contains a step-by-step example of a refactoring session guided by tests. When dealing with untested or legacy code refactoring is dangerous and tests can help us do it the right way, minimizing the amount of bugs we introduce, and possibly completely avoiding them. Refactoring is not easy. It requires a double effort to understand code that others wrote, or that we wrote in the past, and moving around parts of it, simplifying it, in one word improving it, is by no means something for the faint-hearted. Like programming, refactoring has its rules and best practices, but it can be described as a mixture of technique, intuition, experience, risk. 波士顿地铁用 Python 的性能分析 (Pandas, Numpy, MatplotLib 以及 Seaborn) data science Boston’s Massachusetts Bay Transit Authority (MBTA) operates the 4th busiest subway system in the U.S. The MBTA recently began publishing substantial amount of subway data through its public APIs. I performed five analysis. 高效管理 Python 与 Docker 的项目依赖关系 docker, dependency management There are many ways to handle Python app dependencies with Docker. Here is an overview of the most common ones – with a twist. 通过 Sklearn 实现监督学习算法 - 线性回归 supervised learning In this blog, we will see how we can implement Supervised Learning Algorithm. Linear Regression using SkLearn Library in Python. SkLearn or scikit-learn is one of the most widely used tools for Machine Learning and Data Analysis. It does all the computation allowing you to focus on increasing the efficiency and not on the calculation part of the Algorithm. TeachCraft minecraft Learn to program Python within a multiplayer world we all know and love, Minecraft! (是也乎: ) Quart flask, project Quart is a Python asyncio web microframework with the same API as Flask. Quart should provide a very minimal step to use Asyncio in a Flask app. (是也乎: 叕一个针对 Py3 特性的微型 web 框架 from quart import Quart app = Quart(name) @app.route(’/’) async def hello(): return ‘hello’ app.run() 忒象 Bottle 了… ) Github 贡献简历生成器 offtopic This project give you the ability to generate your Resume from your Github contributions. 关于 Python 的 Matplotlib 简介 matpoltlib Matplotlib is a Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. Matplotlib can be used in Python scripts and the jupyter notebook, web application servers, and four graphical user interface toolkits. 使用 Sklearn 的 Count / Hash / TDiF 矢量化器分类文档 machine learning, classification The Sklearn library provides several powerful tools that can be used to extract features from text. In this article, I will show you how easy it can be to classify documents based on their content using Sklearn. Cython 0.26 有咩新咯? cpython PyData 西雅图 2017 视频已经上传 pydata conference 采访 HTTP 提示的 Chang-Hung Liang open source An exploration of the people behind the projects. Each post is an exclusive interview with a member of the open source community. 如何使用转移学习创建图像分类引擎 image processing, tensorflow In this post, we are documenting how we used Google’s TensorFlow to build this image recognition engine. 在组织中分发私有 Python 包的简单方法 dependency management, packages, distribution (是也乎: –> wheelhouse ) 机器学习 NLP:使用scikit-learning,python和NLTK的文本分类 text classification 风格化 Bokeh Visualizations graph Bokeh is a Python interactive visualization library that targets modern web browsers for presentation. Its goal is to provide elegant, concise construction of novel graphics in the style of D3.js, and to extend this capability with high-performance interactivity over very large or streaming datasets. Bokeh can help anyone who would like to quickly and easily create interactive plots, dashboards, and data applications.. Bokeh’s styling is very nice by default. However, extending Bokeh with your own custom styles can add an impressive level of polish to your visualizations. 好物 ~ 包/模块/库/片段… ...

2017-07-28 · 3 min · 1122 words · ZoomQuiet

蠎加载 134

原文: Import Python Weekly Newsletter - Issue No 133 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 首则 Python Notebook - 学习 Pandas pandas A step-by-step guide to analyzing data with Python and the Jupyter Notebook. This textbook will guide you through an investigation of money in politics using data from the California Civic Data Coalition. The course will teach you how to use pandas to read, filter, join, group, aggregate and rank structured data. (是也乎: 值得体验, 一开始不是环境配置的都是骗纸… ) 在Python中重新进行单元测试和模拟 testing, mocking This post covers some higher-level software engineering principles demonstrated in my experience with Python testing over the past year and half. In particular, I want to revisit the idea of patching mock objects in unit tests. 数据科学: Python vs Pandas vs Numpy 的性能 - 机器学习实验 benchmark Speed and time is a key factor for any Data Scientist. In business, you do not usually work with toy datasets having thousands of samples. It is more likely that your datasets will contain millions or hundreds of millions samples. Customer orders, web logs, billing events, stock prices – datasets now are huge. (是也乎: 虽然 Numpy 以及 Pandas 都是 python 写的, 但是,作两样的事儿, 效率就是不同的哪… ) 通用 Jinja: 疯狂的想法 Python-ready 前端 jinja, frontend development Python 3 vs Python 2: 这次真咯不一样了 Python 3 A difficult decision for any Python team is whether to move from Python 2 and into Python 3. Although this is not a new decision for Python development teams, 2017 brings with it several important differences that make this decision crucial for proper forward planning. It feels like this is the year that we’re really seeing the move to Python 3. It has been a long road, but Python 3 may finally have the upper hand. Python 中的解析: 可用的所有工具和库 parsing conda-merge project, reader submission Tool for merging Conda (Anaconda) environment files into one file. This is used to merge your application environment file with any other environment file you might need (e.g. unit-tests, debugging, jupyter notebooks) and create a consistent environment without breaking dependencies from the previous environment files. (是也乎: 刚需哪! ) faker-schema project, reader submission Generate fake data using joke2k’s faker and your own schema. (是也乎: 虚拟数据的模式化生成 ) Dockerizing Django, uWSGI 以及 Postgres 的生产路径 django, docker Let’s dockerize a serious Django application. Curator’s note - Love the humour in the article. 创建自己的 Cryptocurrency - 用 Python cryptocurrency I’ve been itching to build my own cryptocurrency… and I shall give it an unoriginal name - Cranky Coin. After giving it a lot of thought, I decided to use Python. GIL thread concurrency is sufficient. Mining might suffer, but can be replaced with a C mining module. Most importantly, code will be easier to read for open source contributors and will be heavily unit tested. Using frozen pip dependencies, virtualenv, and vagrant or docker, we can fire this up fairly easily under any operating system. (是也乎: 又一种 Coin 的加密算法 ) 创建 Jupyter 笔记本小部件 jupyter This post will provide a step-by-step tutorial for creating and running a Jupyter widget. 让我们建立最小的块链 blockchain In Less Than 50 Lines of Python. Python3 asyncio - 从同步代码调用异步代码 asyncio (是也乎: golang 的最大思想贡献: 用同步代码形式,运行异步效果 ) 好物 ~ 包/模块/库/片段… ...

2017-07-21 · 3 min · 1060 words · ZoomQuiet

蠎加载 133

原文: Import Python Weekly Newsletter - Issue No 133 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 与 Python 中长时间运行的子进程交互 debugging The Python subprocess module is a powerful swiss-army knife for launching and interacting with child processes. It comes with several high-level APIs like call, check_output and (starting with Python 3.5) run that are focused at child processes our program runs and waits to complete. In this post I want to discuss a variation of this task that is less directly addressed - long-running child processes. (是也乎: 作者脑补出了几种方案, 但是,都不嗯哼… 其实吧长时间运行, 要不服务化, 要不事务化, 就别想着中间还能嗯哼什么, 毕竟这是冯机体系不是代码和运行时一致的 LISP 世界. ) 传说: 一个深度学习分类器,可以压缩 Unicode 和奇怪的 Youtube 评论 machine learning One of the things I’ve been thinking about recently is how to do natural language processing (NLP) effectively with deep neural networks using real world language examples. An example would be to classify the youtube comment 探索并清洗科学家联盟的卫星数据库 data science The Union of Concerned Scientists maintains a database of ~1000 Earth satellites. For the majority of satellites, it includes kinematic, material, electrical, political, functional, and economic characteristics, such as dry mass, launch date, orbit type, country of operator, and purpose. The data appears to have been mirrored on other satellite search websites, e.g. http://satellites.findthedata.com/ . This iPython notebook describes a sequence of interactions with a snapshot of this database using the bayeslite implementation of BayesDB, using the Python bayeslite client library. The snapshot includes a population of satellites defined using the UCS data as well as a constellation of generative probabilistic models for this population. 实体提取和网络分析 machine learning How you can extract meaningful information from raw text and use it to analyze the networks of individuals hidden within your data set. 使用 scikit-learn 制作电子商务业务决策 machine learning, scikit-learn Today, let’s learn how to build a simple linear regression model using Python’s Pandas and Scikit-learn libraries. Our goal is to build a model that analyses customer data and solves a problem for a (simulated) e-commerce business. (是也乎: 反复强调了简单的, 即无实用价值的… ) Python 怪癖: 注释 core-python 使用 Locust.io 和 Docker Swarm 进行负载测试 testing, docker, locust FAT Python : Python优化的下一章 optimization The FAT Python project was started by Victor Stinner in October 2015 to try to solve issues of previous attempts of “static optimizers” for Python. Victor has created a set of changes to CPython (Python Enhancement Proposals or “PEPs”), some example optimizations and benchmarks. We’ll explore those 3 levels in this article. K 平均聚类在 Python 中 machine learning f-strings For the Win f-strings It has been a long time coming, but I am now actively migrating existing projects to Python 3. Python 3.6 specifically, because when I am done I will be able to take advantage of my new favourite feature everywhere! That feature is f-strings. (是也乎: PEP-0498 的心声 Python 3.6.1 (…) Type “help”, “copyright”, “credits” or “license” for more… name = ‘Albert’ f’Hello, {name}!' ‘Hello, Albert!’ 嚓, f 算子… ) ...

2017-07-14 · 3 min · 1258 words · ZoomQuiet

蠎加载 132

原文: Import Python Weekly Newsletter - Issue No 132 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 将 Python 和 Assembly 的力量联合起来 asm We can’t just copy/paste ASM directly into a Python script. Instead, python reads the machine code in as a bytearray of shellcode where the binary data is represented by a hex value where the \x represents the offset. (是也乎: ASM … ) pythonbooks.org books Discover the best books in every Python book category. (是也乎: 太实用了…当然的, 没有一本中国原创的. ) 用 Hydrogen 进行交互 IDE Hydrogen is a package for Atom editor that allows interactive programming in different languages. I would call it a bridge, or even a sweet spot, between Jupyter Notebooks and a full blown IDE (like IntelliJ IDEA). (是也乎: 桥件,能将 Jupyter 和 IDE 粘合起来 ) 深入 Closures 和 Decorators - 第一部分 closures 使用进程池加速您的Python数据处理脚本 futures With the concurrent.futures library, Python gives you a simple way to tweak your scripts to use all the CPU cores in your computer at once. Don’t be afraid to try it out. Once you get the hang of it, it’s as simple as using a for loop, but often a whole lot faster. (是也乎: 问题是前提,你的数据是可原子切分处理的 ) 设置 Sublime Text 3 为 Python 进行类型检查 sublime GANs N’ Roses machine learning Imagine one day wherein we had a neural network which could watch movies and generate it’s own movies, or listen to songs and compose new ones. This network would learn from what it sees and hears without you explicitly telling it. This way of letting a neural network learn is known as unsupervised learning. (是也乎: 无监督学习系统的嗯哼 ) PyPy 究竟是什么? pypy PyBay 奖学金计划发布 conference In the spirit of increasing the Python community’s inclusivity and diversity, PyBay is pleased to announce this year’s conference scholarships. Our scholarships are designed to support members of our community for whom attending PyBay would present a financial challenge. 开始 Jupyter Notebook 的5个最佳技巧 jupyter We’ve discussed a few reasons to use Jupyter Notebooks as a GIS user. From visualization of your data to the recent integration with the ArcGIS platform, Jupyter Notebooks are quickly becoming a crucial component of GIS and data science workflows. In spite of these benefits, coming up to speed and getting comfortable with Jupyter Notebooks can be a daunting task for a new user. There is nuance to the way Jupyter Notebooks operate that can take some time to comprehend. (是也乎: 简单的说 ipynb 不是 IDE 也不是编辑器, 而是一个能方便的记录并同时积累我们思考的环境 ) 机器学习和深度学习工程师的基础作弊书 machine learning CheatSheets for Pandas, numpy etc. collections.Counter - Weekly Python Chat counter You want to count the number of times each thing occurs in your list. How do you do it? We’ll talk about the many ways to solve this problem, concluding with the most Pythonic way: Counter. scrapy 中的 404 链接检测器 code snippets 高级 Python 功能 core-python 好物 ~ 包/模块/库/片段… ...

2017-07-07 · 3 min · 1012 words · ZoomQuiet