Python tutorials

Using OrderedDict in Python

Sometimes you need a Python dictionary that remembers the order of its items. In the past, you had only one tool for solving this specific problem: Python’s OrderedDict. It’s a dictionary subclass specially designed to remember the order of items, which is defined by the insertion order of keys. This changed in Python 3.6. The built-in dict class now keeps its items ordered as well. Because of that, many in the Python community now wonder if OrderedDict is still useful. […]

Read more

Python News: What’s New From March 2023

In March 2023, Python 3.12.0 alpha 6 was released! With several exciting new features, improvements, and optimizations, this release is a must-try for all Python enthusiasts. If you want to stay on the cutting edge of Python development, then you should really take it for a spin. But keep in mind that this release isn’t recommended for production. The Python community has been buzzing with activities and events. PyCascades 2023 took place in Vancouver, British Columbia. The event featured talks […]

Read more

Polars for initial data analysis, Polars for production

Initial data analysis (IDA) has different goals than your final, production data analysis: With IDA you need to examine the initial data and intermediate results, check your assumptions, and try different approaches. Exploratory data analysis has similar requirements. Once you’re happy with your approach, and you’re ready to run the analysis in an automated manner, you care a lot more about speed and resource usage. These different goals often benefit from different implementation strategies and tools—unless you have a sufficiently […]

Read more

Python 3.12 Preview: Ever Better Error Messages

Python 3.12 will be released in October 2023. Even though October is still months away, you can already preview some of the upcoming features, including how Python 3.12 will offer even more readable and actionable error messages. In this tutorial, you’ll: Experience the improved communication in various error situations Learn about the background and limitations of these changes Peek into the CPython source code of the pull requests that made these error messages sparkle There are many other improvements and […]

Read more

Check if a Python String Contains a Substring

If you’re new to programming or come from a programming language other than Python, you may be looking for the best way to check whether a string contains another string in Python. Identifying such substrings comes in handy when you’re working with text content from a file or after you’ve received user input. You may want to perform different actions in your program depending on whether a substring is present or not. In this video course, you’ll focus on the […]

Read more

Python’s del: Remove References From Scopes and Containers

Python’s del statement will allow you to remove names and references from different namespaces. It’ll also allow you to delete unneeded items from your lists and keys from your dictionaries. If you want to learn how to use del in your Python code, then this tutorial is for you. The del statement empowers you to better manage memory resources in your code, making your programs more efficient. To get the most out of this tutorial, you should be familiar with […]

Read more
1 43 44 45 46 47 185