Planet Python RSS
216 subscribers
16.9K links
Unofficial Planet Python RSS feed from planetpython.org. Maintained by @cfinnberg
Download Telegram
Real Python: How to Catch Multiple Exceptions in Python

Link: https://realpython.com/python-catch-multiple-exceptions/

In this tutorial, you’ll learn various techniques to catch multiple exceptions with Python. To begin with, you’ll review Python’s exception handling mechanism before diving deeper and learning how to
Python⇒Speed: Speeding up Floyd-Steinberg dithering: an optimization exercise

Link: https://pythonspeed.com/articles/optimizing-dithering/

pre {
white-space: pre;
overflow-x: auto;
font-size: 80%;
}


The common advice when Python is too slow is to switch to a low-level compiled language.
But what do you do if that code is to
Stack Abuse: Getting Today's Date in YYYY-MM-DD in Python

Link: https://stackabuse.com/getting-todays-date-in-yyyy-mm-dd-in-python/

Introduction
Whether you're logging events or measuring execution times, you'll often find yourself working with dates. In Python, the built-in datetime module makes it easy to get the current date an
death and gravity: When to use classes in Python? When you repeat similar sets of functions

Link: https://death.andgravity.com/same-functions

Are you having trouble figuring out when to use classes or how to organize them?
Have you repeatedly searched for "when to use classes in Python",
read all the articles and watched all the talks,
and
PyBites: Your First Python Open Source Contribution: A Step-By-Step Guide

Link: https://pybit.es/articles/your-first-python-open-source-contribution-a-step-by-step-guide/

Introduction
I recently re-engaged with one of my open source projects and it was a rewarding experience.
It was a Pybites project I had written the core for years ago, but thanks to some amazing Pyt
TypeThePipe: Efficient Column Selection in Polars: Utilizing Polars Selectors for Python DataFrame Manipulation

Link: https://typethepipe.com/vizs-and-tips/python-polars-selectors-select-multiple-columns/

pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.source
PyBites: 6 Cool Things You Can Do With The Functools Module

Link: https://pybit.es/articles/6-cool-things-you-can-do-with-the-functools-module/

In this article let’s look at the functools Standard Library module and 6 cool things you can do with it (be warned, a lot of decorators are coming your way! ) …
1. Cache (“memoize”) things
You can us
Stack Abuse: Convert Index of a Pandas DataFrame into a Column in Python

Link: https://stackabuse.com/convert-index-of-a-pandas-dataframe-into-a-column-in-python/

Introduction
There are times when using Pandas that you may find yourself needing to convert the row index to a column of its own. This may be a useful operation for a couple of reasons, which we'll s
Stack Abuse: Calculate Mean Across Multiple DataFrames in Pandas

Link: https://stackabuse.com/calculate-mean-across-multiple-dataframes-in-pandas/

Introduction
The Pandas library offers a plethora of functions that make data manipulation and analysis super simple (or at least simpler). One such function is the mean() function, which allows you t
Wesley Chun: Managing Team Drives with Python and the Google Drive API

Link: http://wescpy.blogspot.com/2017/06/managing-team-drives-with-python-and.html

2019 UPDATE: "G Suite" is now called "Google Workspace", and "Team Drives" is now known as "Shared Drives". Please take note of these changes as you review the post below.NOTE 1: Teams Drives is only
Peter Bengtsson: Pip-Outdated.py with interactive upgrade

Link: http://www.peterbe.com/plog/pip-outdated.py-with-interactive-upgrade

Last year I wrote a nifty script called Pip-Outdated.py "Pip-Outdated.py - a script to compare requirements.in with the output of pip list --outdated". It basically runs pip list --outdated but filter
Stack Abuse: How to Flatten Specific Dimensions of NumPy Array

Link: https://stackabuse.com/how-to-flatten-specific-dimensions-of-numpy-array/

Introduction
In data manipulation and scientific computing, NumPy stands as one of the most-used libraries as it provides quite a few functionalities. One such operation, "flattening," helps to transf
William Minchin: minchin.jrnl v7 “Phoenix” released

Link: https://blog.minchin.ca/2023/09/minchin-jrnl-700-released.html

Today, I do something that I should have done 5 years ago, and something that
I’ve been putting off for the last 2 years1: I’m releasing a personal fork
of jrnl2! I’ve given this release the codename
Stack Abuse: How to Pass Multiple Arguments to the map() Function in Python

Link: https://stackabuse.com/pass-multiple-arguments-to-the-map-function-in-python/

Introduction
The goal of Python, with its rich set of built-in functions, is to allow developers to accomplish complex tasks with relative ease. One such powerful, yet often overlooked, function is th
Real Python: The Real Python Podcast – Episode #173: Getting Involved in Open Source & Generating QR Codes With Python

Link: https://realpython.com/podcasts/rpp/173/

Have you thought about contributing to an open-source Python project? What are possible entry points for intermediate developers? Christopher Trudeau is back on the show this week, bringing another ba
Stack Abuse: Fix the "AttributeError: module object has no attribute 'Serial'" Error in Python

Link: https://stackabuse.com/fix-the-attributeerror-module-object-has-no-attribute-serial-error-in-python/

Introduction
Even if you're a seasoned Python developer, you'll occasionally encounter errors that can be pretty confusing. One such error is the AttributeError: module object has no attribute 'Serial
Stack Abuse: Importing Python Modules

Link: https://stackabuse.com/importing-python-modules/

Introduction
Python allows us to create just about anything, from simple scripts to complex machine learning models. But to work on any complex project, you'll likely need to use or create modules. Th
Stack Abuse: How to Position Legend Outside the Plot in Matplotlib

Link: https://stackabuse.com/how-to-position-legend-outside-the-plot-in-matplotlib/

Introduction
In data visualization, often create complex graphs that need to have legends for the reader to be able to interpret the graph. But what if those legends get in the way of the actual data
Stack Abuse: How to Check for NaN Values in Python

Link: https://stackabuse.com/how-to-check-for-nan-values-in-python/

Introduction
Today we're going to explore how to check for NaN (Not a Number) values in Python. NaN values can be quite a nuisance when processing data, and knowing how to identify them can save you f
Kushal Das: Documentation of Puppet code using sphinx

Link: https://kushaldas.in/posts/documentation-of-puppet-code-using-sphinx.html


Sphinx is the primary documentation
tooling for most of my projects. I use it for the Linux command line
book too. Last Friday while in a chat with Leif about
documenting all of our puppet codebase,