蠎加载 139

原文: Import Python Weekly Newsletter - Issue No 139 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 用 flit 轻松发布你的包 pypi Flit is a simple way to Package and deploy Python projects on PyPI, Flit makes it easier by using a simple flit.ini file and assumes common defaults to save your time and typing. I knew about Flit when I was taking a look at Mariatta Wijaya game called Tic Tac Taco Pizza and noticed that she used flit to deploy the game, so we also asked her the reason for using this on the podcast we recorded so I decided to try porting my projects to Flit. 用 Python 进行研究 - edX 课程 ( Harvard University ) course, mooc This course bridges the gap between introductory and advanced courses in Python. While there are many excellent introductory Python courses available, most typically do not go deep enough for you to apply your Python skills to research projects. In this course, after first reviewing the basics of Python 3, we learn about tools commonly used in research settings. Python 的 sys.getrefcount() 趣味 core-python Python has a function called sys.getrefcount() that tells you the reference count of an object. 用机器学习来预测获胜团队 machine learning Can we predict the outcome of a football game given a dataset of past games? That’s the question that we’ll answer in this episode by using the scikit-learn machine learning library as our predictive tool. 用 Docker 组合 Travis CI 进行持续集成的姿势 docker, CI Part 2 of 3: The “Docker repo” pattern. Note - Very informative and detailed article for those looking to bring CI + docker into their workflow. (是也乎: 城会玩 -> ) 使用 Python 分析 Cryptocurrency Markets cryptocurrency How do Bitcoin markets behave? What are the causes of the sudden spikes and dips in cryptocurrency values? Are the markets for different altcoins inseparably linked or largely independent? How can we predict what will happen next? (是也乎: 数字货币交易市场越来越兴旺, 而且数据是公开的, 值得分析 ) 用 Python Flask, Pandas 以及 MongoDB 折腾出分析仪表盘 mongodb, pandas, flask Analyzing your sensor data has always been a daunting task and putting your data in the Dashboard has never been an easy task. In this article, we will see how using Python Flask, Pandas and MongoDB you can develop an Analytical Dashboard over a weekend. (是也乎: 有用, 但还是丑… ) 拟态 testing, mocking Mimesis is a fast and easy to use library for Python, which helps generate mock data for a variety of purposes (see “Data providers”) in a variety of languages (see “Locales”). This data can be particularly useful during software development and testing. The library was written with the use of tools from the standard Python library, and therefore, it does not have any side dependencies. (是也乎: 不是 erlang 那个内置 DB 哪… 能模拟各种语言数据集的工具… 好象支持中文? ) 纤程, 线程和进程 parallel processing Python 列表的实现 core-python USER-USER 协同过滤推荐系统 recommendation engine we will start building a system that uses the profile of the given user and provide recommendation completely based on that user’s preference and liking. Gaussian Naive Bayes - numpy machine learning Bayes Theorem describes the probability of an event, based on prior knowledge of conditions be related of conditions to the event. So it basically fits perfectly for machine learning, because that is exactly what machine learning does: making predictions for the future based on prior experience. (是也乎: 叕一则科普文… ) Python Matplotlib Style - 2.0 matpoltlib Matplotlib is a great and very capable plotting library for Python. (是也乎: 可惜一直没有解决互联网时代的直接输出需求… ) 如何使用 Python 删除或修改 CSV 数据集中的空值 code snippets, csv Data sets are not perfect. Sometimes they end up with invalid, corrupt, or missing values. For the project I was working on, I could not have any values that are null or empty. This How-To will walk you through writing a simple Python script to see if your data set has null or empty values, and if so, it will propose two options for how to modify your data. 如何使用 Cloudinary 和 Python 加速工艺术网站的加载 cloudinary pip 黑魔法 ~ 一键升级所有 Python 模块 pip 使用 PySpark Dataframe – Zhiqiang Zhong – Medium pyspark, dataframes I will share you about how using Dataframe of PySpark as Dataframe of Python. 如何跨越 CPython 解释器 cpython I will outline the process I typically follow to dig deeper into aspects of the python programming language I am curious about. Python: Guidelines & Code Style coding standards This document is intended to Storepilots employees, but worth the read. http(s) session recording 技巧 http pep 551 PEP This PEP describes additions to the Python API and specific behaviors for the CPython implementation that make actions taken by the Python runtime visible to security and auditing tools. The goals in order of increasing importance are to prevent malicious use of Python, to detect and report on malicious use, and most importantly to detect attempts to bypass detection. Most of the responsibility for implementation is required from users, who must customize and build Python for their own environment. (是也乎: 有关运行安全的嗯哼 ) What is self healing software? humor 用 CFFI 将 Python 链接到 C c 让我们在 Python 中同步线程 (是也乎: 让我们荡起双桨 ) Nuitka - Python Complier compiler Nuitka is a Python compiler. It’s fully compatible with Python 2.6, 2.7, 3.2, 3.3, 3.4, 3.5, and 3.6. You feed it your Python app, it does a lot of clever things, and spits out an executable or extension module. (是也乎: 又一个 编译器, 可以递归的将 python 脚本以及依赖库编译成单一 .exe 但是,类似 Qt/OpenCV/numpy/pandas/… 巨型模块, 就别想了… ) Python 加密作弊书 cryptocurrency pyheatmagic ipython IPython magic command to profile and view your python code as a heat map using py-heat. (是也乎: 自动分析代码执行热度的插件… ) 好物 ~ 包/模块/库/片段… ...

2017-08-25 · 5 min · 2145 words · ZoomQuiet

蠎加载 138

原文: Import Python Weekly Newsletter - Issue No 138 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 单元测试和模块 unittest video In this Python Programming Tutorial, we will be learning how to unit-test our code using the unittest module. Unit testing will allow you to be more comfortable with refactoring and knowing whether or not your updates broke any of your existing code. Unit testing is a must on any large projects and is used by all major companies. Not only that, but it will greatly improve your personal code as well. Let’s get started. (是也乎: 叕一个 TDD 方面的嗯哼了… ) Python 线程 - Multithreading Playlist videos, multithreading 数据科学 Rosetta Stone: 分类 在 Python, R, MATLAB, SAS, 以及 Julia | Heaton Research data science 自动将 Python 2 代码翻译成 3 的 Python 3 This web is a online converter that reads Python 2.x source code and applies a series of fixers to transform it into valid Python 3.x code Enter your Python2 code on the left, hit the button, and boom, Python3 code on the right (是也乎: 可以嘛?敢用嘛? ) Python 队列死锁的悲伤故事 concurrency This is a story about how very difficult it is to build concurrent programs. It’s also a story about a bug in Python’s Queue class, a class which happens to be the easiest way to make concurrency simple in Python. This is not a happy story: this is a tragedy, a story of deadlocks and despair. 如何在 Python 领域成为专家? core-python Notebook based off James Powell’s talk at PyData 2017. (是也乎: 配合 youtube 的一则 ipynb 分享, metaclasses 开始… ) 仔细看看 Python f-strings 如何工作 f-strings F-strings provide a concise and convenient way to embed python expressions inside string literals for formatting. (是也乎: 针对 PEP 498 的嗯哼 ) 谁负责维护 PyPI 以及负责? pypi Reddit Discussion Hy 的小小一步 - 我的 lispy Python 经验 lisp Roughly, Hy is to Python as Clojure is to Java. Hy completely inter-ops with Python. I’ve hit commit 1,500 in my Hy project at work. I wanted to share my experience working with Hy, where I feel it shines and where it falls short. (是也乎: 等等-> Clojure LISP?! 叕一个为了 LISP 的方言, py 造… #! /usr/bin/env hy (print “I was going to code in Python syntax, but then I got Hy.”) 意思是可以用 Python 来学习 Scheme 了?! ) Python 和 Haskell 中的左右折叠->原始递归模式 haskell A “fold” is a fundamental primitive in defining operations on data structures; it’s particularly important in functional languages where recursion is the default tool to express repetition. In this article I’ll present how left and right folds work and how they map to some fundamental recursive patterns. The article starts with Python, which should be (or at least look) familiar to most programmers. It then switches to Haskell for a discussion of more advanced topics like the connection between folding and laziness, as well as monoids. (是也乎: 等等? Haskell ?! ) 用 Python 分析和测试 C c-code C is relatively difficult to write, making it harder to analyse and test. It would be helpful to be able to do this with a higher level language, such as Python. Analysis and testing don’t affect performance of the actual data structure, so using a slower but easier and more productive language for this seems reasonable. In this article, we walk though a simple example of doing this with a built-in Python library for interfacing with C called ctypes. 在 Python 中使用 GDAL / OGR 对地址进行地理编码和执行点多边形测试 geo This short post shows how to use Python packages googlemaps and GDAL. Debugging 在 Python debugging One of the reasons why I love the Python programming language is because of how easy debugging is. You don’t need a full blown IDE to be able to debug your Python application. We will go through the process of debugging a simple Python script using the pdb module from the Python standard library, which comes with most installation of Python. (是也乎: 叕一个 debug 的经验分享, 只是 print() 可以解决 99% 情况时,有什么新动力要用… ) 引入新的图像注释类型 - Python 代码片段 image processing We’re excited to be launching a bunch of new annotation types for images. Since the launch of our bounding box API, we’ve annotated millions of images with boxes to identify a host of different objects, from cars and hats to roof damage and parking lots. Scale is becoming an industry-standard tool for solving computer vision problems. 用 lehar 在终端展示数据 visualization The post is about a terminal visualization tool lehar that is open sourced at https://github.com/darxtrix/lehar (是也乎: Find commits by authors in a git repo $ git shortlog -s | cut -f1 | lehar ▇▁▁▁▁▁▁▂▃▁▁█▁▁▂▃▅▁▁▁▂▆▁▁▁▂▁▁▁▁▂▇▁▅▆▁▁▁▄▁▁█▁▁▂▁▂▁ 还有这种操作?! ) Select & Prefetch Related django Today the #DjangoTip will be about using select_related and prefetch_related to improve our queries performance. Note - Django developer do check out django newsletter - http://djangoweekly.com 好物 ~ 包/模块/库/片段… ...

2017-08-19 · 4 min · 1899 words · ZoomQuiet

蠎加载 137

原文: Import Python Weekly Newsletter - Issue No 137 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 怪癖 core-python Favorite #pythonoddity tweets by @treyhunner (是也乎: 叕一组高端黑技巧…其实,知道了, 也别用哪… ) Python 的 AI research - podcast podcast Today you’ll meet Alex Lavin, a Python developer and research scientist at Vicarious where they are trying to develop artificial general intelligence for robots. Python 装饰器正确的打开方式: 编程语言的4位观众 - Code Without Rules decorators If you’re a Python programmer, the following post will show you why decorators exist, and how to compensate for their limitations. Python 的机器学习搭车客指南 machine learning Featuring implementation code, instructional videos, and more Amazon S3 文件系统 Python 版 aws, s3 I’d like to announce an new Python module to make working with Amazon S3 files a whole lot easier. (是也乎: 叕一个 S3 的封装, 不过, 有人能嗯哼得过官方的任性嘛?! ) 在 Django 清晰的架构 django This post will try to explain our approach to apply Clean Architecture on a Django Restful API. It is useful to be familiarized with Django framework as well as with Uncle Bob’s Clean Architecture before keep reading. (是也乎: 好吧 –> Clean Architecture 是个专有功能… ) 两周用对 Pandas 技术 pandas 50行 Python 代码来预测股票 stock trading In this blog post we’re going to build a stock price predication graph using scimitar-learn in just 50 lines of Python. (是也乎: scimitar-learn 都封装好了 ) DjangoTip-> 玩转 Querysets django PSF 新闻 PSF The Ethical Maintainer: Community Service Award Recipient Glyph Lefkowitz. 从 Scratch 支持 Spotify 的 Sublime 插件 sublime plugin Part 1 - Series Introduction & Environment Setup. Pycon Australia 2017 Videos pycon 好物 ~ 包/模块/库/片段… ...

2017-08-12 · 3 min · 1387 words · ZoomQuiet

蠎加载 136

原文: Import Python Weekly Newsletter - Issue No 136 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 对 Python object 反向工程 python object I faced an interesting challenge at work the other day. I felt like sharing because it might save a few hours for others, or reveal some insights about the Python internals. Python 正则表达式 regular expression In this video series, we will be tackling Python Regular Expressions. The first few videos we will go over the basics, and then tackle some intermediate problems using Python Regular Expressions. (是也乎: 叕一个正则表达式的嗯哼…可见好东西永远掌握在少数人心中… ) 使用进程池加速您的Python数据处理脚本 process pool (是也乎: 问题在,数据处理首先得是可以切片并发的哪… ) 基于 机器学习 用 Python 开发牌照识别系统 machine learning In this tutorial, I’ll be taking you through the basics of developing a vehicle license plate recognition system using the concepts of machine learning with Python. (是也乎: 用的是 scikit-image ) Python init.py & modular Imports core-python, code snippets (是也乎: 又常用又破烦的事儿… ) Logging in Python logging logging beyond 101 (是也乎: ( ̄▽ ̄) 这是没个头儿的… ) 用 Sightengine 发觉名人 machine learning We will see in this article how to detect if an image contains celebrities with Sightengine. Sam 清洁 Citadel (GoT) 以10小时,用 Python video processing Curator’s Note - I am a big Game of Thrones fan so had to share this. As a fan of Game of Thrones, I couldn’t wait for it to return for a 7th season. Watching the season premier, I greatly enjoyed that iconic scene of Sam doing his chores at the Citadel. I enjoyed it so much that I wanted to see more of it… much more of it. In this post we’ll take the short video compilation of Sam cleaning the Citadel, we will split it to multiple sub clips and create a video of Sam cleaning the Citadel using a random mix of those sub clips. sinuous-violin - Numpy and SciPy numpy, scipy The aim of this short notebook is to show how to use NumPy and SciPy to play with spectral audio signal analysis (and synthesis). (是也乎: ipynb 可以播放音乐了 ) Pandas 分组和 Agg 函数解释 pandas Every once in a while it is useful to take a step back and look at pandas’ functions and see if there is a new or better way to do things. I was recently working on a problem and noticed that pandas had a Grouper function that I had never used before. I looked into how it can be used and it turns out it is useful for the type of summary analysis I tend to do on a frequent basis. Yosai 和 Darin Gordon – Episode 120 – Podcast podcast For any program that is used by more than one person you need a way to control identity and permissions. There are myriad solutions to that problem, but most of them are tied to a specific framework. Yosai is a flexible, general purpose framework for managing role-based access to your applications that has been decoupled from the underlying platform. This week the author of Yosai, Darin Gordon, joins us to talk about why he started it, his experience porting it from Java, and where he hopes to take it in the future. (是也乎: 介绍通用 ACL 框架 Yosai ) 使用 Cython 来保护 Python 代码库 cpython Recently, I worked on a Python project that required the whole codebase to be protected using Cython. Although protecting Python sources from reverse engineering seems like a futile task at first, cythonizing all the code leads to a reasonable amount of security (the binary is very difficult to disassemble, but it’s still possible to e.g. monkey patch parts of the program). This security comes with a price though - the primary use case for Cython is writing compiled extensions that can easily interface with Python code. Therefore, the support for non-trivial module/package structures is rather limited and we have to do some extra work to achieve the desired results. (是也乎: 同时还能立即获得速度的提升, 问题在迁移的成本… ) 控制 Python 异步蠕变 asyncio The complication arises when invoking awaitable functions. Doing so requires an async defined code block or coroutine. A non-issue except that if your caller has to be async, then you can’t call it either unless its caller is async. Which then forces its caller into an async block as well, and so on. This is “async creep”. (是也乎: 雪崩在异步场景中的兄弟… ) 神密的 Dynamic Programming algorithms Maybe you’ve heard about it in preparing for coding interviews. Maybe you’ve struggled through it in an algorithms course. Maybe you’re trying to learn how to code on your own, and were told somewhere along the way that it’s important to understand dynamic programming. Using dynamic programming (DP) to write algorithms is as essential as it is feared. 优化 Pandas 代码速度的初学指南 pandas 写个 a map-reduce 任务来嗯哼数百万个小文件 mrjob, mapreduce 使用 TensorFlow 检测伪钞 tensorflow Today, let’s use TensorFlow to build an artificial neural network that detects fake banknotes. Hacking 相似搜索,用 python project What would you do if you wanted to know which files are the most similar to a particular text-based file? For example to find a particular configuration file which has changed its filename and its contents. 好物 ~ 包/模块/库/片段… ...

2017-08-04 · 4 min · 1982 words · ZoomQuiet