Custom Python Dictionaries: Inheriting From dict vs UserDict

Creating dictionary-like classes may be a requirement in your Python career. Specifically, you may be interested in making custom dictionaries with modified behavior, new functionalities, or both. In Python, you can do this by inheriting from an abstract base class, by subclassing the built-in dict class directly, or by inheriting from UserDict. In this tutorial, you’ll learn how to: Create dictionary-like classes by inheriting from the built-in dict class Identify common pitfalls that can happen when inheriting from dict Build […]

Read more

Using the Python not Operator

Python’s not operator allows you to invert the truth value of Boolean expressions and objects. You can use this operator in Boolean contexts, such as if statements and while loops. It also works in non-Boolean contexts, which allows you to invert the truth value of your variables. Using the not operator effectively will help you write accurate negative Boolean expressions to control the flow of execution in your programs. In this course, you’ll learn: How Python’s not operator works How […]

Read more

Build a Flashcards App With Django

Flashcards are a great tool when you want to memorize a new topic or learn a new language. You write a question on the front of the card and the answer on the back of the card. Then you can test your memory by going through the flashcards. The more often you show a card to yourself, the better your chances of memorizing its content. With Django, you can build your own flashcards app. By following this tutorial, you’ll build […]

Read more

NumPy’s max() and maximum(): Find Extreme Values in Arrays

You’ve now seen examples of all the basic use cases for NumPy’s max() and maximum(), plus a few related functions. Now you’ll investigate some of the more obscure optional parameters to these functions and find out when they can be useful. Reusing Memory When you call a function in Python, a value or object is returned. You can use that result immediately by printing it or writing it to disk, or by feeding it directly into another function as an […]

Read more

SQLite and SQLAlchemy in Python: Moving Your Data Beyond Flat Files

All programs process data in one form or another, and many need to be able to save and retrieve that data from one invocation to the next. Python, SQLite, and SQLAlchemy give your programs database functionality, allowing you to store data in a single file without the need for a database server. You can achieve similar results using flat files in any number of formats, including CSV, JSON, XML, and even custom formats. Flat files are often human-readable text files—though […]

Read more

Python and TOML: New Best Friends

TOML—Tom’s Obvious Minimal Language—is a reasonably new configuration file format that the Python community has embraced over the last couple of years. TOML plays an essential part in the Python ecosystem. Many of your favorite tools rely on TOML for configuration, and you’ll use pyproject.toml when you build and distribute your own packages. In this tutorial, you’ll learn more about TOML and how you can use it. In particular, you’ll: A new module for TOML parsing is being added to […]

Read more

4 Business AI Predictions for 2022-2023

AI as a field, especially in the context of real-world applications, has been progressing at a rapid pace. This has been further accelerated by the onset of the COVID-19 pandemic. In fact, AI was found to be the most discussed technology in 2021. Having worked with numerous clients, big and small, in the integration of AI, here are 4 Business AI predictions in 2022 and beyond. #1 Many more “deployed” models In the recent past, businesses have had trouble operationalizing […]

Read more

Machine Translation and Multilinguality in May and June 2022

After a while, here is a dump of what I found most interesting on arXiv about machine translation and multilinguality, covering May and June of this year. Google Research published a pre-print of their NAACL paper: SCONES (Single-label Contrastive Objective for Non-Exclusive Sequences). The paper is about a simple trick: they replace softmax with binary classifiers with a sigmoid output and use the sum of binary cross-entropies as their loss function. It gets a slightly better BLEU and BLEURT score […]

Read more

Machine Learning Course Notes

Over the last couple of years, I have been sharing lots of educational content as a way to give back to the community. More recently, I decided to open-source all my study notes which include topics like deep learning, machine learning, and natural language processing. The goal of this new project is to share more about my strategy and thought process of how I gain knowledge and practical skills. All the notes are written using Notion which makes it easy […]

Read more

Python News: What’s New From June 2022

June 2022 brought a flurry of exciting news for the Python community! The PSF received funding for a new role focused on security, and held elections for four seats on the board of directors. Results from two important developer surveys were published, and new versions of both Python and some popular packages saw the light of day. PEP 691 got accepted, extending the Simple API for Python packaging indexes. With the Python 3.12 change page live, you can now start […]

Read more
1 147 148 149 150 151 908