蠎加载 125

原文: Import Python Weekly Newsletter - Issue No 125 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… How to Publish Your Package on PyPI? pypi When you’ve written some great code, you might want to make this available for others to use as well. The pythonic way of sharing a package is making it available on PyPI. Let’s create a simple package and go through the process of publishing it! (是也乎: 简单的说, PyPI 还在独立打造专用软件仓库, 实在是…. ) Python 测试与 pytest:简单,快速,有效和可扩展 来自 Brian Okken |实用书架 testing, book Do less work when testing your Python code, but be just as expressive, just as elegant, and just as readable. The pytest testing framework helps you write tests quickly and keep them readable and maintainable—with no boilerplate code. Using a robust yet simple fixture model, it’s just as easy to write small tests with pytest as it is to scale up to complex functional testing for applications, packages, and libraries. This book shows you how. Dhruv Govil 聊 Python 在电影工业中的作用 podcast Movies are magic, and Python is part of what makes that magic possible. We go behind the curtain this week with Dhruv Govil to learn about how Python gets used to bring a movie from concept to completion. He shares the story of how he got started in film, the tools that he uses day to day, and some resources for further learning. (是也乎: 自古就和 3D 电影的看作绑定在一起了,列表一下俺不知道的: Rez Alembic Geometry Storage Format Fabric Engine Pyblish … ) 用 Python 对 NY 的出租车数据建立 ML 分类器以便生成推荐 bigquery, datawarehouse I demonstrate the power of the Google BigQuery engine by building a classifier which will predict whether a NY city taxi ride will result in a generous tip or no tip at all. As part of doing this I explore the dataset and look at relationships in the dataset. I also visualize the pickups around the city and the result is a scatterplot which essentially draws the city streets of NY. (是也乎: Google BigQuery 的又一个 demo ) 用 Python 和 Google Docs 构建图书 docx Daniel ( Co-Author of Two Scoops of Django ) shares how he put Python ( python-docx library ) along with Google Docs to create his latest self-published fiction book. (是也乎: .docx 的爱恋… ) 将 Sublime Text 嗯哼成最好的全桟 Python IDE sublime3 Train/Test Split and Cross Validation in Python data science Argparse vs Click CLI Command line arguments processing library. (是也乎: 简单的说, 哪个顺手哪个就是你最好的… ) Python 在 Mac OSX 中的合理部署 installation, macos-x (是也乎: 还在使用 virtualenv … 这种中古环境控制技术了… ) 用 Python 和 Mxnet 构建机器学习的现代人脸识别 machine learning In this post, we’ll discuss and illustrate a fast and robust method for face detection using Python and Mxnet. 南方公园文本分析 - 第1部分:TF-IDF machine learning I noticed recently that Kaggle has an interesting dataset?—?70,000 lines of South Park dialogue. It’s nicely labelled by episode and character. I figured it would be a good practical test for the TF-IDF tools in scikit learn that I’ve been wanting to try recently. (是也乎: 著名 TV 的台词大数据也慢慢公开出来了, 相同的技术可以用来分析各种古典文学作品的… ) 用 Python Generator 来监视数据 videos David Beazley demonstrates how to use a generator in Python to watch real-time data sources. This is an excerpt from the Pearson video course “Python Programming Language”. 拼写与元素符号 codesnippet Sitting in my 5-hour-long chemistry class, my gaze would often drift over to the periodic table posted on the wall. To pass the time, I began to try finding words I could spell using only the symbols of the elements on the periodic table. Some examples: ScAlEs, FeArS, ErAsURe, WAsTe, PoInTlEsSnEsS, MoISTeN, SAlMoN, PuFFInEsS. I wondered what the longest such word was (‘TiNTiNNaBULaTiONS’ was the longest one I could come up with). Then I started thinking about how nice it would be to have a tool that could find the elemental spellings of any word. I decided to write a Python program. lambda, map 和 filter 在 Python core-python, lamda, map, filter lambda operator or lambda function is used for creating small, one-time and anonymous function objects in Python. Pandas DataFrames 和 MultiIndex 简单演示 pandas Pandas Dataframes generally have an “index”, one column of a dataset that gives the name for each row. It works like a primary key in a database table. But Pandas also supports a MultiIndex, in which the index for a row is some composite key of several columns. It’s quite confusing at first, here’s a simple demo of creating a multi-indexed DataFrame and then querying subsets with various syntax. (是也乎: Pandas 中最好用也是最嗯哼的, 就是 dataframes 上的索引了… ) Python + Docker: 从开发到生产:第一集 dockers 制定最大化收入的定价策略 numpy, pandas, scipy Turns out, selling lemonade is a perfect scenario to introduce dynamic pricing and price optimization techniques. In this post, we’ll be finding an optimal price for our glasses of lemonade using some basic methodology in Python in order to maximize our revenue. Pandas 和 Python 真实世界项目 (GPS data) pandas Analysis and plotting of GPS data using pandas 2017 年 Python 最赞的 15 个数据科学库 data science As Python has gained a lot of traction in the recent years in Data Science industry, I wanted to outline some of its most useful libraries for data scientists and engineers, based on recent experience. And, since all of the libraries are open sourced, we have added commits, contributors count and other metrics from Github, which could be served as a proxy metrics for library popularity. (是也乎: 讲真,无论库发展的如何,最后拼的还是平台服务哪 ) 用 AWS Lambda 检查 PCAP 文件 aws, lamda, pcap, scapy AWS Lambda is a service that allows you to run code without provisioning a server. This has some interesting possibilities especially when processing data asynchronously. When I first started learning about Lambda most of the examples were about resizing images. I work with PCAP files on a daily basis and have used scapy for several years so thought it would be a good experiment to use Lambda to do some simple PCAP inspection. 好物 ~ 包/模块/库/片段… ...

2017-05-18 · 4 min · 1720 words · ZoomQuiet

蠎加载 124

原文: Import Python Weekly Newsletter - Issue No 124 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 包的各种层次 packaging Packaging in Python has a bit of a reputation for being a bumpy ride. This is mostly a confused side effect of Python’s versatility. Once you understand the natural boundaries between each packaging solution, you begin to realize that the varied landscape is a small price Python programmers pay for using the most balanced, flexible language available. (是也乎: PyPI is not an app store 对当前混乱的 py 库现状进行了洗地… ) ...

2017-05-14 · 3 min · 1173 words · ZoomQuiet

蠎加载 123

原文: Import Python Weekly Newsletter - Issue No 123 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 嗯哼掉 GIL: 快速写和线程安全的Python gil static PyThread_type_lock interpreter_lock = 0; /This is the GIL/ This line of code is in ceval.c, in the CPython 2.7 interpreter’s source code. Guido van Rossum’s comment, “This is the GIL,” was added in 2003, but the lock itself dates from his first multithreaded Python interpreter in 1994. On Unix systems, PyThread_type_lock is an alias for the standard C lock, mutex_t. It is initialized when the Python interpreter begins: (是也乎: 挖出对应代码, 13年前的坑… 为这用心的配图手工点赞…少数没有被功夫认证了的技术 blog 了… ) Asyncio Coroutine 模式: 超越等待 asyncio concurrent programming is hard and while coroutines allow us to avoid callback hell it can only get you so far, you still need to think about creating tasks, retrieving results and graceful handling of errors. Sad face. Good news is all of that is possible in asyncio. Bad news is it’s not always immediately obvious what wrong and how to fix it. Here are a few patterns I’ve noticed while working with asyncio. (是也乎: py3 only 的坑模式…其实咧这类事儿,直接用 go 吧. ) 3分钟内在 Jupyter Notebook 用起 PySpark jupyter, spark Python is the perfect language for prototyping in Big Data/Machine Learning fields. Plus, there is no Jupyter Notebook in Scala: PySpark is our only option. 构建优良 Celery 异步任务的自查清单 Best Practices, Monitoring & Tests, Resources for celery. 该怎么用 Python Debugger debugging The Python debugger provides a debugging environment for Python programs. It supports setting conditional breakpoints, stepping through the source code one line at a time, stack inspection, and more. 有关 Django 中预取应该知道的全部 - By Haki Benita ORM 使用 单一责任 原则重构 Python 代码库 refactoring The Single Responsibility Principle (SRP) is an effective strategy against this sort of problem by reducing the amount of code in the several layers of your codebase, focusing each one on specific objectives and separating them by logical domain. poet pip Poet helps you declare, manage and install dependencies of Python projects, ensuring you have the right stack everywhere. The package is highly experimental at the moment so expect things to change and break. However, if you feel adventurous I’d gladly appreciate feedback and pull requests. (是也乎: 又一个 pip 的增强工具, 问题是所有 PyPi 的外围工具都没有很好的解决工程中最要命的一个需求: 如何将开发环境 一键迁移/备份/恢复/部署/升级/.. 到目标主机中? 而不依赖外部资源 <– 至今也就见过 dh-virtualenv 依赖 Debain 的软件包机制完成了 py 环境的真正封装… ) 语言中的性别偏见 - 新闻文本语料库中的双语分析 bigrams, ngrams, maching learning 如何用 Chromium 和 PyInstaller 将 Web 应用程序转换为桌面应用程序 sofi, desktopUI I’ve been working on a Python module called Sofi that generates user interfaces. It can deliver a desktop feel while using standard single-page web technologies. For flexibility, I designed it to work through two methods of distribution: in-browser and executable. (是也乎: 这简直是在抢 React 的饭碗哪! ) 用 Async Python 3.6 和 Redis 编写快速应用程序 redis, async 城市中的自驾车神经网络 tensorflow In this self-driving car with Python video, I introduce a newer, much more challenging network and task that is driving through a city. 玩树莓Pi:交通灯 IOT I’ve recently been doing some simple Python programming with the Raspberry Pi and a set of traffic light LEDs that connect to it. In this post I’ll look at setting up a Pi to drive the lights. 用 scikit-learn 搞出学习排名 scikit-learn 在IPython或Jupyter中使用Python unittest jupyter, test Configuration for running unittest in IPython or Jupyter is different than running unittest from command line. 好物 ~ 包/模块/库/片段… ...

2017-05-04 · 3 min · 1329 words · ZoomQuiet

蠎加载 122

原文: Import Python Weekly Newsletter - Issue No 122 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… PyCon JP 2017 议题开始征集 pycon Our team is looking for a wide range of each topic which you would like to talk. The same as in the past, we are planing to have talk session(30minute), poster session(booth style), Lighting talks(5minute) and more. Even if you are a python beginner, please do not hesitate to apply for it. 用 Python Flask NASA API 以及 Twilio MMS 和火星机器人聊天 flask, nasa NASA has a bunch of awesome APIs which give you programmatic access to the wonders of space. I think the Mars Rover Photos API in particular is really amazing as you can use it to see what kind of pictures the Mars Curiosity rover has been taking. Let’s build an app using the Mars Rover API with Twilio MMS, Python and Flask to make it so that we can text a phone number and receive pictures from Mars. (是也乎: 嗯哼?! 通过短信远程控制火星上的机械来拍摄? ) Jupyter Notebook Hints jupyter First of all, I want to point out that it is very flexible tool to create readable analyses, because one can keep code, images, comments, formula and plots together: (是也乎: IPython 已经进化为 Jupyter 也越来越令人沉迷了,,总是想为什么世界不是 .ipynb 组成的? ) 如何用 Python 比较文档相似性? gensim Learn how to use the gensim Python library to determine the similarity between two or more documents. 用 OpenCV, Python, 和 dlib 进行 blink 检测 opencv In last week’s blog post, I demonstrated how to perform facial landmark detection in real-time in video streams.Today, we are going to build upon this knowledge and develop a computer vision application that is capable of detecting and counting blinks in video streams using facial landmarks and OpenCV. Two Scoops of Django: Django 1.11 最佳实践已经发布 python The latest Edition focuses on Two Scoops of Django is out. I recall buying the first edition which was based on 1.5. This book holds a special place in the Django community IMHO. This Edition is focused on Django 1.11 and Python 3, with an appendix for working with Python 2.7. Revised material on nearly every topic within the book. 20+ pages of new material on Django REST Framework, security, forms, models, and more. I look forward to doing a review of the book as soon as it launches in Dead Tree Format in my country ( India ) like the previous editions. (是也乎: 已经在用… ) 制造魔法(Jupyter notebook + PixieDust) jupyter Getting started with custom visualizations, simple tables & word clouds (是也乎: 词云以及其它 ) Subreddit 映射和分析 numpy, pandas, scipy The goal of this notebook is to build and analyse a map of the 10,000 most popular subreddits on Reddit. (是也乎: 又一个 ipynb 实例分析 ) Python Collections 模块 collections module This module implements specialized container datatypes providing alternatives to Python’s general purpose built-in containers, dict, list, set, and tuple. (是也乎: 妄图替代 dict, list, set, 以及 tuple 这类内建容量对象的嗯哼… ) List 链接和排列 list 又一个 Numpy 库快速介绍 numpy Neo4j 和 Cypher 查询语言的 Pythonic 探索 video, neo4js This talk gives an overview of the Neo4j graph database and the Cypher query language from the point of view of a Python user. We’ll look at how to run queries and visualise or extract those results into software such as Pandas. We’ll also explore the property graph data model and look at how it differs from other data models. PyData 阿姆斯特丹 2017 视频 pydata MicroPython 概述 micropython 如何限制 asyncio 内存使用? asyncio One of the first hurdles that you can encounter when trying out asyncio is “asyncio eats all my memory!”. Indeed, to keep you CPU busy, you’re encouraged to launch a lot of coroutines simultaneously. coroutines don’t use a lot of memory by themselves, but what you’re doing inside them can use quite a lot of memory. 用 TensorFlow 折腾机械学习 tensorflow (是也乎: 又一个 ) 好物 ~ 包/模块/库/片段… ...

2017-04-28 · 3 min · 1216 words · ZoomQuiet