Planet Python RSS
216 subscribers
16.9K links
Unofficial Planet Python RSS feed from planetpython.org. Maintained by @cfinnberg
Download Telegram
Stack Abuse: Fix "local variable referenced before assignment" in Python

Link: https://stackabuse.com/fix-local-variable-referenced-before-assignment-in-python/

Introduction
If you're a Python developer, you've probably come across a variety of errors, like the "local variable referenced before assignment" error. This error can be a bit puzzling, especially f
Stack Abuse: How to Send "multipart/form-data" with Requests in Python

Link: https://stackabuse.com/how-to-send-multipart-form-data-with-requests-in-python/

Introduction
If you've ever needed to send files or data to a server via a POST request, you've likely had to use multipart/form-data. In this Byte, we'll see how to send these requests using the requ
PyCoder’s Weekly: Issue #595 (Sept. 19, 2023)

Link: https://pycoders.com/issues/595

#595 – SEPTEMBER 19, 2023 View in Browser » Inheritance and Internals: Object-Oriented Coding in Python In this video course, you’ll learn about the various types of inheritance that you can use
Python Bytes: #353 Hatching Another Episode

Link: https://pythonbytes.fm/episodes/show/353/hatching-another-episode

<strong>Topics covered in this episode:</strong><br>

<ul>
<li><a href="https://stackoverflow.blog/2023/07/27/announcing-overflowai/"><strong>OverflowAI</strong></a></li>
<li><a href="https://andrich
PyBites: Why Start Your Programming Journey With Python?

Link: https://pybit.es/articles/why-start-your-programming-journey-with-python/

Diving into Programming with Python
I’ve spent years entertaining the thought of becoming a software developer, only to get overwhelmed by the vast array (pun intended) of programming languages to cho
Quansight Labs Blog: Array API Support in scikit-learn

Link: https://labs.quansight.org/blog/array-api-support-scikit-learn

In this blog post, we share how scikit-learn enabled support for the Array API Standard.
Kushal Das: SBOM and vulnerability scanning

Link: https://kushaldas.in/posts/sbom-and-vulnerability-scanning.html


Software Bill of
Materials became one of
the latest buzzword. A lot of people and companies talking about it like a
magical thing, if you use it then all of your security problems will be solved,
jus
Mike Driscoll: Learning About Code Metrics in Python with Radon

Link: https://www.blog.pythonlibrary.org/2023/09/20/learning-about-code-metrics-in-python-with-radon/

There are many different tools that you can install to help you be a better Python programmer. For example, you might install pytest so that you can do unit tests of your code. Or you might install Ru
Stack Abuse: Find the Index of an Item in a List in Python

Link: https://stackabuse.com/find-the-index-of-an-item-in-a-list-in-python/

Introduction
In this Byte we're going to take a look at one of the most common tasks you can do with a list: finding the index of an item. Luckily, this is usually a pretty simple task - but there are
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