26 Dec 2022 Juliano Luiz Faccioni How to Filter a Python Dictionary Learn how to build your own filters with multiple conditions, then use them to filter Python dictionaries by any combination of keys and values. Python dictionaries are extremely versatile. They can hold a variety of data types and are used to model many different real-world objects and relations. It is no surprise, then, that we want to perform specific operations (like filtering) on Python dictionaries. Filtering a dictionary in Python can be especially tricky because they can be filtered by key, values, or both, using an arbitrary number of conditions. Read more 30 Nov 2022 Juliano Luiz Faccioni How to Loop Over Multiple Lists in Python Learn how to loop over multiple lists side-by-side in Python – one element at a time. These techniques will work even if the lists have different lengths! Looping over lists is one of the most basic skills in Python. In some situations, you may find yourself having to loop over multiple lists side-by-side, taking one element from each list and performing an operation with it. If you’re new to Python, it is not always obvious how to do that or what caveats and best practices exist for this task. Read more 23 Nov 2022 Juliano Luiz Faccioni Python Scripts vs. Jupyter Notebooks: Pros and Cons Learn the ins and outs of Python scripts and Jupyter Notebooks, including when to use each one. There are many tools available to Python developers. Since this language’s early days, Python scripts have been the canonical way of writing and sharing Python code. But in the past few years, Jupyter Notebooks have gained considerable recognition among data scientists as a powerful tool for testing ideas and sharing results. But what exactly sets Jupyter Notebooks apart from Python scripts? Read more 29 Oct 2022 Juliano Luiz Faccioni A Brief Guide to Python Exceptions Confused about programming errors? In this article, you’ll learn what Python exceptions are, how to deal with them, and how to leverage them when writing and organizing your code. Errors are very common in programming. In Python, we use the term “exception” for errors that happen during code execution. Be it a typo, a coding distraction, or because the code reached an invalid state, it is inevitable: the more you write Python programs, the more you will have to face and handle Python exceptions. Read more 28 Sep 2022 Juliano Luiz Faccioni An Overview of Python List Methods Learn how to modify lists in Python using list methods – specialized operations that give you tons of flexibility. Python lists have a lot of functionality that you can leverage in your scripts. This includes common sequence operations like adding elements to a list, reordering elements, and counting the number of times a given element appears in a list. Collectively, these operations are called list methods. In this article, we will go through an overview of Python’s main list methods. Read more 7 Sep 2022 Juliano Luiz Faccioni How to Reverse a Range in Python Find out how to reverse a range in Python and learn more about the range(), reversed(), and sorted() functions. Early in your Python journey, you’ll start working with sequences and ranges. At some point, you may wonder ‘How would I get these values in the reverse order?’. If you think about it, we reverse ranges constantly: when we sort files in our computer from ascending to descending order, we effectively reverse their original order. Read more 8 Aug 2022 Juliano Luiz Faccioni Python Set Operations Explained With Examples Having a hard time wrapping your head around set operations in Python? This article will help you visualize and understand Python set operations! Python sets are useful data structures when you need to create and compare groups of elements. These tasks can be performed with set operations like union and intersection. However, using Python set operations may not be a straightforward task when you’re first starting out with Python itself. Read more 8 Jul 2022 Juliano Luiz Faccioni An Overview of Python String Methods Become a master of common Python string methods and level up your data manipulation skills! Python strings have a lot of functionality that you can leverage in your scripts. This includes common text operations like searching and replacing text, removing whitespace, or counting characters and words. Collectively, these functions are called Python string methods. In this article, we’ll go through an overview of the main string methods available for Python scripts. Read more 27 May 2022 Juliano Luiz Faccioni 5 Ways to Create a Dictionary in Python Want to step up your Python game? Learn how to create dictionaries in Python from many different sources, including reading from JSON files and combining two dictionaries. So, you've already figured out how to use dictionaries in Python. You know all about how dictionaries are mutable data structures that hold key-value pairs. You understand you must provide a key to the dictionary to retrieve a value. But you may not have realized dictionaries in Python come in all shapes and sizes and from all kinds of sources. Read more «« « 1 2 » »»