格式化 Python 字符串/越来越复杂.

原文: PyCoder's Weekly - Issue #448

pycoder

  • 201125 Zoom.Quiet(大妈) 用时 42 分钟 完成快译
  • 201125 Zoom.Quiet(大妈) 用时 37 分钟 完成格式转抄.

Creating realistic data for testing applications can be difficult, especially when you have complex data requirements and privacy concerns make using real data problematic. Enter Synthetic Data Vault, a tool for modeling datasets that closely preserves important statistics, like mean and standard variation.

Once you learn about for loops in Python, you know that using an index to access items in a sequence isn’t very Pythonic. So what do you do when you need that index value? In this tutorial, you’ll learn all about Python’s built-in enumerate(), where it’s used, and how you can emulate its behavior.

(是也乎:

enumerate

enumerate 是强力模块, 但是名字太复杂, 以至大家下意识的选择无视?

)

If your application uses Conda to manage dependencies, you face a dilemma. On the one hand, you want to pin all your dependencies to specific versions, so you get reproducible builds. On the other hand, once you’ve pinned everything, upgrades become difficult. Enter conda-lock.

(是也乎:

conda 也值得有专用依赖管理工具.

)

In this course, you’ll learn how to perform more complex string pattern matching using regular expressions, or regexes, in Python. You’ll also explore more advanced regex tools and techniques that are available in Python.

(是也乎:

Regular

为什么真蟒出课这么快? 流水线?

)

探讨/吐糟

Discussions

(是也乎:

wx

所以, 当然用现成的.

)

(是也乎:

描述式编程和指令式编程...

)

文章/教程/嗯哼

Articles, Tutorials and Talks

Here are ten practical and little-known pandas tips to help you take your skills to the next level.

Python’s bisect module has tools for searching and inserting values into sorted lists. It’s one of his “batteries-included” features that often gets overlooked, but can be a great tool for optimizing certain kinds of code.

Serialization transforms data into a format that can be stored or transmitted and then reconstructs it for use. There are some quick-and-dirty ways to serialize data in pure Python, but you often need to perform more complex actions during the serialization process, like validating data. The Django REST Framework has some particularly robust and full-featured serializers.

Are you interested in learning more about Natural Language Processing? Have you heard of sentiment analysis? This week on the show, Kyle Stratis returns to talk about his new article titled, Use Sentiment Analysis With Python to Classify Movie Reviews. David Amos is also here, and all of us cover another batch of PyCoder’s Weekly articles and projects.

(是也乎:

podcast

群口

)

In this course, you’ll see two items to add to your Python string formatting toolkit. You’ll learn about Python’s string format method and the formatted string literal, or f-string. You’ll learn about these formatting techniques in detail and add them to your Python string formatting toolkit.

(是也乎:

C 语言只能一种格式化, Python 发展到现在已经有无数姿势了, 但是, 我们还是不满足...

所以, 还是 LISP 们比较聪明?

)

Did you know Python has two different kinds of packages: regular packages and namespace packages? It turns out that trying to import a regular package when you don’t have the right permissions causes Python to import it as a namespace package, and some unexpected things happen.

(是也乎:

这也是 Pythonista 几大常见困惑...

ZEMEK

作者 blog 的标签, 所以, 很难遇见只有 Python 体验的 Pythonista ?

)

Python extensions are a great way to leverage performance from another language while keeping a friendly Python API. How viable are Rust and Go for writing Python extensions? Are there reasons to use one over the other?

(是也乎:

俺感觉马上将有 Julia 加入这个扩展阵营...

)

In this tutorial, you’ll learn why it’s important to split your dataset in supervised machine learning and how to do that with train_test_split() from scikit-learn.

(是也乎:

Dataset

发型真不错.

)

This free, open-source book will help you learn more about IPython, a rich toolkit that helps you make the most out of using Python interactively.

(是也乎:

所以, Python 终于找到了 PHP-体位?

Web

)

Learn how to add some motion and a third dimension to a photo using depth estimation and inpainting.

好物/妙品/...

Interesting Projects, Tools and Libraries, Projects & Code

(是也乎:

后来俺才知道, 音频和图像没什么区别, 都是矩阵运算...

klio

GitHub 自从上岸后, 第一时间关闭了针对大陆的图床解析, 果然 M$ 更加懂中国.

)

(是也乎:

全新的项目脚手架思路...

)

(是也乎:

叕一个 Rust 绑定, 其实嘦用 GCC 类编译为机器码的语言, 都可以外挂给 Py 来耍...

)

(是也乎:

Ya~哑,

这个名称前缀真的可以千秋万代了...

)

(是也乎:

acts

现在 github 项目没几个图标都不敢用了...

等等, 为什么要在多种 shell 中反复切换?

)

📆🐍 活动/大会

Events, MeetUp 真的是全球线下活动组织中心

(是也乎:

真蟒 找到赢利模式后, 就开始稳定开放了...

)

PyCon2020中国

DAMA

❤️ Happy Pythonic ;-(大妈私人无责任播报)

None

PS:


好文笔,感叹号年度配额: 2/3

投稿/反馈邮箱:

askdama@googlegroups.com

(邮件列表地址, 当成正常邮件发送邮件就好, 不用注册, 不用翻越...)


ZoomQuiet/大妈

就是四处 是也乎,( ̄▽ ̄) 的那个大妈:

私自嗯哼: ZoomQuiet (订阅号: ZoomQuiet42)
公开课程: 蟒营 (订阅号: Mainium)
历史吐糟: Chaos42 (订阅号 PythoniCamp)

as 创始组织者:
    PyChina (订阅号: PyChinaOrg)
    本地社区: 
        GDG珠海 (订阅号: GDG-ZhuHai)
        TFUG珠海 (订阅号: ZH_TFUG)

NN 4208

RPP


Comments



自怼圈/年度番新

DU21.7
关于 ~ DebugUself with DAMA ;-)

关注公众号, 持续获得相关各种嗯哼:
zoomquiet

追问

任何问题, 随时邮件提问可也:
askdama@googlegroups.com


蟒营®编程思维提高班Python版

**2021.01.11** 因大妈再次创业暂停定期开设, 转换为预约触发:
  • + 扫描预约入群, 学员每满 42 人即启动新一期训练营 ;-)
  • 101camp21.7
  • + 任何问题, 随时邮件提问可也:
    askdama@googlegroups.com