蠎加载 163

原文: Import Python Weekly Newsletter - Issue No 163 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 如何用 Jupyter Notebooks 以及 pandas 来分析数据? pandas, jupyter Last year we discovered an extensive dataset on the subject of traffic on German roads provided by the BASt. It holds detailed numbers of cars, trucks and other vehicle groups passing more than 1,500 automatic counting stations. The amazing thing about this dataset is that the records for each counting station are provided on an hourly basis and they reach back to the year 2003. As an attempt to get to know the structure and to find a good way for dealing with the massive size of the dataset, we set up some Jupyter (formerly IPython) Notebooks. (是也乎: 叕一篇 ipynb 的软文, 问题在, 依然没有解决从探索到作品的转化时机和技巧问题. ) 编写 Unit Tests 来测试 REST APIs testing I’m working on a project called BadgeYay. It is a badge generator with a simple web UI to add data and generate printable badges in PDF. BadgeYay’s back-end is now shifted to REST-APIs and to test functions used in REST-APIs, we need some testing technology that will test each and every function used in the API. For our purposes, we chose the popular unit tests Python test suite. In this blog post, I’ll be discussing how I have written unit tests to test BadgeYay’s REST-API. 极简 AWS Lambda + Python + Terraform 配置 aws, lambda I want to write and deploy the simplest function possible on AWS Lambda, written in Python, using Terraform. (是也乎: 是的, OSX 中实现的… ) 4 个途径来提升 DevOps Testing - Free eBook sponsor You already know the longer it takes to detect a problem, the more expensive it is to resolve. Your testing needs to happen earlier in the development pipeline while taking into account all aspects of privacy, security and monitoring. Read the 4-part eBook to learn how to detect problems earlier in your DevOps testing processes by:… 用 Python 创建 Discord Bot bot In this video we’ll cover how to create a bot for Discord. This bot will be able to join a server and show up in the user list. It will be able to interact in chat rooms and private messages and respond to custom commands. 用 Redis+Python 创建共享单车应用 project, web application Learn how to use Redis and Python to build location-aware applications. (是也乎: 很久没有听到 SOLOMO/LBS 的实例了… ) 介绍 Datalore - 叕一则用 Python 来进行机械学习的工具 data, jetbrains This Monday, February the 12th, we launched a public beta of Datalore - an intelligent web application for data analysis and visualization in Python, brought to you by JetBrains. This tool turns the data science workflow into a delightful experience with the help of smart coding assistance, incremental computations, and built-in tools for machine learning. 用 Python 和 Scikit-Learn 实现 K-Nearest 邻居算法 scikit-learn In this article, we will see how KNN can be implemented with Python’s Scikit-Learn library. But before that let’s first explore the theory behind KNN and see what are some of the pros and cons of the algorithm. The Flask Mega-Tutorial Part XI: Facelift flask This is the eleventh installment of the Flask Mega-Tutorial series, in which I’m going to tell you how to replace the basic HTML templates with a new set that is based on the Bootstrap user interface framework. Apache Airflow 作为分布式系统的外部调度程序 airflow So have you ever needed a reliable External scheduler for your distributed systems? Apache Airflow (by Airbnb) has a good stable scheduler. So how can we use Airflow for this purpose, here’s how we did. (是也乎: 可能是俺错觉, 凡是发布在 medium 中的技术文章都比较科普… 没有作者在自己 blog 上的文章来的有用… ) 什么是单元和覆盖测试以及如何在 Python 中实现和使用它们 unit testing 好物 ~ 包/模块/库/片段… ...

2018-02-19 · 4 min · 1516 words · ZoomQuiet

蠎加载 162

原文: Import Python Weekly Newsletter - Issue No 162 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 免费 Python 书: 开始 Python, 高级 Python, 以及 Python 练习 book This document is a self-learning document for a course in Python programming. This course contains (1) a part for beginners, (2) a discussion of several advanced topics that are of interest to Python programmers, and (3) a Python workbook with lots of exercises. (是也乎: 叕一本 Python 入门书. ) 类似Snapchat AR 过滤器 augmentedreality My project lets you try on virtual pairs of sunglasses or masks. To achieve this I utilized python, Dlib, OpenCV, Scipy, and Numpy. The pipeline involves opening a live webcam feed, detecting keypoints on faces in the feed, warping a png image of sunglasses to match the face, rotating the png with face movements, and blending the two images together so they look like one real image. (是也乎: 叕一个 Python 实现的简易 AV 面具嗯哼工具 ) Python - Clean Design 的分类 core-python Some Python programmers like to think of their language as flawless. I personally know some Python programmers claiming that Python is superior to other languages in its clean design and unmatched elegance. This however isn’t true. Python has at least as many deep and fundamental flaws as most other languages, despite parts of its community claiming something different. 将Python项目打包到Debian .deb 第1部分 packaging Hi, Have you ever try to package your code/project to became .deb or in official Debian or Ubuntu Repository to share to the rest of the world? (是也乎: 发布 Python 工程为 .deb … 是的, 很少有人发布为 .exe/.msi ) Python 弱性能问题 performance What changed in my reasoning? First of all, I’m working on other problems. Whereas I used to do a lot of work that was very easy to map to numpy operations (which are fast as they use compiled code), now I write a lot of code which is not straight numerics. And, then, if I have to write it in standard Python, it is slow as molasses. I don’t mean slower in the sense of “wait a couple of seconds”, I mean “wait several hours instead of 2 minutes.” (是也乎: Python 中的囧问题, 几小时都算不出来的场景.. ) 信用建模与 Dask dask This post explores a real-world use case calculating complex credit models in Python using Dask. It is an example of a complex parallel system that is well outside of the traditional “big data” workloads. NumPy 教程第1部分 - Python 数组入门 numpy Numpy is the most basic and a powerful package for scientific computing in python. This is part 1 of a mega-tutorial covering all the core aspects of performing data manipulation and analysis with numpy’s ndarrays. 63.8% – Python 3 移植数据库 python3, community, fedora This is a dashboard to track progress of porting Fedora packages to Python 3. From Mordor, with love: 从头开始设计异步任务调度库 - Part-2 future In layman terms, a future is an object which can hold the value or result of some computation done asynchronously. What does that mean ? Python to Google Sheets google sheets (是也乎: docs.google 的表格终于有 Python 接口了, 当然, 大陆用不了. ) “Group By” 在 SQL 以及 Python: 比较 pandas, sql Exploring the overlapping functionality of SQL and Python can help those of us familiar with one language become more adept with the other. And with a deep understanding of both, we can all make smarter decisions about how to combine and leverage each, making it easy to always choose the right tool for every task. (是也乎: Group By 的叕一个嗯哼… ) 好物 ~ 包/模块/库/片段… ...

2018-02-12 · 4 min · 1538 words · ZoomQuiet

蠎加载 161

原文: Import Python Weekly Newsletter - Issue No 161 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… “装饰器模式” 以及 Python “wrapt” 模块. wrapt Brandon Rhodes published a post today about the Decorator Pattern and how that translates into Python. He explains the manual way that the pattern can be implemented in Python as a wrapper, as well as how you can try to minimise the amount of work you need to do by overriding special methods of a Python object. The wrapt package I authored was purpose built for this task of creating wrappers which Brandon describes, and much more. To avoid some of the name confusion around Decorator Pattern versus Python decorators, which Brandon highlights as an issue, I tend to refer to the wrappers as transparent object proxies. (是也乎: 叕一个对原生特性增强的模块,来自 Hear no evil, see no evil, patch no evil: Or, how to monkey-patch safely. - YouTube https://www.youtube.com/watch?v=GCZmGgtWi3M NZPyUG 的年度大会 KiwiPyCon 2017… 14年就发布的老梗, 作者还在一直讲… ) 预测第一投手的薪水 data science, jupyter Today’s post focuses on applying linear regression techniques to a less-than-ideal dataset. In order to do so, I need a scenario from which to work. As of this writing, the MLB free agent signing period (or ‘Hot Stove’ as it is affectionately named) is in full effect. Therefore, I chose the following problem statement as my challenge: my client, a professional baseball team, is interested in offering a contract to a free agent starting pitcher and wants a recommendation for the annual salary it should propose. Now that I have my problem, I can begin working on the answer! (是也乎: 线性回归技术的一个真实案例 ) 用 AWS Lambda 来爬取数千产品 Selenium, lamda, chromedriver Or how to run Headless Chrome on AWS Lambda together with Python, Selenium and Chromedriver (是也乎: 无头 Chrome 的又一个嗯哼案例 ) Zulko/moviepy: 用Python编辑视频 video MoviePy (full documentation) is a Python library for video editing: cutting, concatenations, title insertions, video compositing (a.k.a. non-linear editing), video processing, and creation of custom effects. See the gallery for some examples of use. (是也乎: MoviePy 的确是一个完备的视频折腾工具, 可以说是 FFmpeg 的 Pythonic 包装 ) Django — Asset compression and Storages django The problem was, once we change something in the CSS/JS, that change was not getting reflected on the client side and browser was taking the old files from the cache. To avoid this, we needed a mechanism to refresh the cache once anything has changed in the CSS/JS. The obvious approach was to change the name or attach a version number to a CSS file each time we make a change. But we wanted this process to be automated so we came across Django-compressor. 在 Windows,Mac 和 Linux 上处理文件路径的简单方法 core-python Python 3.4 introduced a new standard library for dealing with files and paths called pathlib?—?and it’s great! (是也乎: Py3 的软文叕一则 ) Jupyter Notebook 技巧来提高 Data Science 效率 jupyter (是也乎: 叕一则 Jupyter 的数据科学嗯哼技巧 ) 用 Bounter pt. 2 有效地计数: CountMinSketch counter In my previous post on the new open source Python Bounter library we discussed how we can use its HashTable to quickly count approximate item frequencies in very large item sequences. Now we turn our attention to the second algorithm in Bounter, CountMinSketch (CMS), which is also optimized in C for top performance. Reportlab: 用 Python 进行 PDF 处理 ~ Mike Driscoll — Kickstarter kickstarter Learn how to create PDFs using the popular Python programming language and the ReportLab toolkit. Kickstarter campaign. gist-evernote project, gist, evernote A Python application that sync Github Gists and save them to Evernote notebook as screenshots. Python 中监督机器学习算法 machine learning The main goal of this reading is to understand enough statistical methodology to be able to leverage the machine learning algorithms in Python’s scikit-learn library and then apply this knowledge to solve a classic machine learning problem. The first stop of our journey will take us through a brief history of machine learning. Then we will dive into different algorithms. On our final stop, we will use what we learned to solve the Titanic Survival Rate Prediction Problem. 用 Python 解压缩 zip 文件的最快方法 code snippet, zip So the context is this; a zip file is uploaded into a web service and Python then needs extract that and analyze and deal with each file within. In this particular application what it does is that it looks at the file’s individual name and size, compares that to what has already been uploaded in AWS S3 and if the file is believed to be different or new, it gets uploaded to AWS S3. (是也乎: 不是不用解压缩就能使用所有内容的嘛? ) 好物 ~ 包/模块/库/片段… ...

2018-01-31 · 4 min · 1661 words · ZoomQuiet

蠎加载 160

原文: Import Python Weekly Newsletter - Issue No 160 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 折腾: 如果 None 在等式左边? core-python A natural default, None is probably the most commonly assigned value in Python. But what happens if you move it to the left side of that equation? (是也乎: 经典不折腾要死星人的游戏… ) 理解 Python 类内部 core-python The goal of this series is to describe internals and general concepts behind the class object in Python 3.6. In this part, I will explain how Python stores and lookups attributes. I assume that you already have a basic understanding of object-oriented concepts in Python. (是也乎: 叕一次尝试嗯哼 class 的行为 ) 如何将 PyLint 集成到自己的 PyCharm 工作流 ? pycharm PyCharm has it’s own built-in linting, which is already useful and nicely integrated. However, it misses much that PyLint catches. In this post I explain how I integrate PyLint into PyCharm as an external tool, with links from the PyLint results back to the python file. (是也乎: 叕一个 PyLint 技巧 ) 使用 Python 进行哈佛大学研究课程 - MOOC course Take your introductory knowledge of Python programming to the next level and learn how to use Python 3 for your research. (是也乎: 叕一个春虅大学的 MOOC ) 用 Tensorflow 对象检测在 Android 上检测皮卡丘 tensorflow Deep inside the many functionalities and tools of TensorFlow, lies a component named TensorFlow Object Detection API. The purpose of this library, as the name says, is to train a neural network capable of recognizing objects in a frame, for example, an image. (是也乎: Pikachu 已经正式成为现实世界物种了? ) 集群上的分布式 Pandas 中折腾 Dask DataFrames pandas Dask Dataframe extends the popular Pandas library to operate on big data-sets on a distributed cluster. We show its capabilities by running through common dataframe operations on a common dataset. (是也乎: 叕叕叕又一个 Dataframe 的嗯哼, 这次分布式了… ) Pangeo: 云上的 JupyterHub, Dask, 以及 XArray geo A few weeks ago a few of us stood up pangeo.pydata.org, an experimental deployment of JupyterHub, Dask, and XArray on Google Container Engine (GKE) to support atmospheric and oceanographic data analysis on large datasets. This follows on recent work to deploy Dask and XArray for the same workloads on super computers. This system is a proof of concept that has taught us a great deal about how to move forward. This blogpost briefly describes the problem, the system, then describes the collaboration, and finally discusses a number of challenges that we’ll be working on in coming months. (是也乎: Jupyter 的生态越来越丰富了… ) pyclbr core-python, packages pyclbr can scan Python source to find classes and stand-alone functions. The information about class, method, and function names and line numbers is gathered using tokenize without importing the code. (是也乎: 这个可以有 ;-) Py3 内建模块的工程支持工具. 再结合 Graphviz 就是工程代码图谱了… ) Python 3.7 数据类简介 core-python, 3.7 A Brand-new feature in Python 3.7 is “Data Classes”. Data classes are a way of automating the generation of boiler-plate code for classes which store multiple properties. (是也乎: 多重属性类的生成 ) Learn Leap Fly: 用 Python 和 Kjell Wooding 提升全球读写能力 – Episode 145 – Podcast.init podcast Learning how to read is one of the most important steps in empowering someone to build a successful future. In developing nations, access to teachers and classrooms is not universally available so the Global Learning XPRIZE serves to incentivize the creation of technology that provides children with the tools necessary to teach themselves literacy. Kjell Wooding helped create Learn Leap Fly in order to participate in the competition and used Python and Kivy to build a platform for children to develop their reading skills in a fun and engaging environment. In this episode he discusses his experience participating in the XPRIZE competition, how he and his team built what is now Kasuku Stories, and how Python and its ecosystem helped make it possible. (是也乎: Kivy 构建的教育支持平台… ) 用 Python 进行 Linux 系统挖掘 platform module In this article, we will explore the Python programming language as a tool to retrieve various information about a system running Linux. Let’s get started. (是也乎: Glance 你值得拥有… ) Google Colab Free GPU 教程 pytorch Now you can develop deep learning applications with Google Colaboratory -on the free Tesla K80 GPU- using Keras, Tensorflow and PyTorch. (是也乎: Google 全家桶也支持 PyTorch 了… ) 在 TensorFlow 中使用 tf.Print() tensorflow Today I’ll show how TensorFlow’s print statements work, and how to make the most of them, hopefully saving you some confusion along the way. 在Python中处理时间戳和时区转换 datetime 好物 ~ 包/模块/库/片段… ...

2018-01-27 · 4 min · 1535 words · ZoomQuiet