蠎加载 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

蠎加载 159

原文: Import Python Weekly Newsletter - Issue No 159 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 如何加速 Python 应用程序的启动时间? processing time Python 3.7 has new feature to show time for importing modules. This feature is enabled with -X importtime option or PYTHONPROFILEIMPORTTIME environment variable. (是也乎: Py3.7 果断划出很多精力来提升速度 ) 使用文本分析来量化角色 NLTK If you’ve ever worked on a text and wished you could get a list of characters or see how many times each character was mentioned, this is the tutorial for you. (是也乎: NLP 基础分析需求叕一次工具化 ) 在 asyncio 应用程序中寻找内存泄漏 memory leaks, async Sailing into the last two weeks of 2017 that I fully intended to spend experimenting with various eggnog recipes. I was alerted by our DevOps team that our asyncio app was consuming 10GB of memory. That is approximately 100 times more than it should! (是也乎: 等等, Python 也有内存嗯哼问题? 一个从 10亿回到100M 的故事 ) DjangoCon JP 2018 conference DjangoCon JP is a conference for the Django Web framework in Japan. If you’re a seasoned Django pro or just starting, DjangoCon JP is for you. Our goal is for atendees to meet, talk, share tips, discover new ways to use Django, and, most importantly, have FUN. (是也乎: 国外的技术大会世家都是年初, 中国的在年尾…所以, 基于文化还是经济原因呢? ) 路径 flat 即功成 code-quality If you want to write clear and easy to understand software, make sure it has a single success path. A ‘single success path’ means a few things. First, it means that any given function/method/procedure should have a single clear purpose. (是也乎: 很久没有见这种代码品质的经验讨论了… ) 规范化流程教程,第1部分:分布和决定因素 tensorflow This series is written for an audience with a rudimentary understanding of linear algebra, probability, neural networks, and TensorFlow. Knowledge of recent advances in Deep Learning, generative models will be helpful in understanding the motivations and context underlying these techniques, but they are not necessary. 预制 Docker 镜像基于 GPU 来 OpenAI Gym 开发和 TensorFlow docker, tensorflow So, you want to write an agent, competing in the OpenAI Gym, you want to use Keras or TensorFlow or something similar and you don’t want everything installed on your workstation? You have come to the right place! (是也乎: 随着 tensorflow 工具链的增长,这个 Docker 的体积当然的将越来越嗯哼 ) 用 Python 检查 Coinbase 中收支平衡 coinbase Even though Coinbase has a mobile application so you’re able to check your balance on the go, I prefer using their API instead so I can setup custom alerts not available on their platform. (是也乎: Coinbase, 哈, 一看名字就知道是相关什么 ) 使用 bower 通过 Django 管理静态文件 django Sharing a way to manage libraries like bootstrap, jquery with bower without using any external app. (是也乎: 所以, PHP 发明之初就内置的工具, Django 一直在嗯哼 ) 自动模型选择:H2O AutoML modeling In this post, we will use H2O AutoML for auto model selection and tuning. This is an easy way to get a good tuned model with minimal effort on the model selection and parameter tuning side. (是也乎: 叕一个 AI 框架. ) Python 中的逻辑回归 sklearn 好物 ~ 包/模块/库/片段… ...

2018-01-19 · 4 min · 1513 words · ZoomQuiet