|
🔗 Stories, Tutorials & Articles |
|
|
|
Using "any" and "all" in Python ✅ |
|
|
Python's any and all functions are built-in functions that can help check whether all or any items match a given condition in an iterable. Instead of using a for loop and a conditional statement, one can use the any and all functions along with a generator expression to make the code more concise and readable. The any function returns True if at least one item is truthy, while the all function returns True if all items are truthy. It is also possible to use the in operator to check if a given item is contained in an iterable. |
|
|
|
|
|
|
|
Hello Dolly: Democratizing the magic of ChatGPT with open models ✅ |
|
|
Databricks has released an open source language model called Dolly , which has been trained on a small corpus of instruction data and fine-tuned to exhibit ChatGPT-like interactivity. Despite being only 6 billion parameters and two years old, Dolly exhibits instruction-following capabilities such as brainstorming and text generation. The release of Dolly is part of Databricks' effort to democratize large language models and help organizations build their own models rather than relying on centralized LLM providers. However, the technology is still in its early stages and users should be aware of potential issues such as factual accuracy, bias, and offensive responses. |
|
|
|
|
|
|
4 ways to build dbt Python models |
|
|
dbt is a powerful data transformation tool that supports SQL transformation and model creation. It was originally created in Python but is intended for SQL transformation. However, with the trend towards language convergence among various data warehouse vendors, the trend towards support for Python in dbt is on the rise. This article covers how to create a dbt Python model for use with Snowflake, Databricks, Google BigQuery and third-party adapters such as dbt-fal. The article explores the benefits of using Python with dbt, including being able to apply machine learning techniques to data transformation. |
|
|
|
|
|
|
The different uses of Python type hints |
|
|
Using type hints in Python helps with autocomplete, refactor, static analysis, and tool checks while working with annotated libraries like Pydantic, FastAPI, etc. Type hints can distinguish immediate error checking and type checking for build & deployment processes. Different use cases require awareness before adding type hints, which may be irrelevant if the codebase rejects them. |
|
|
|
|
|
|
Limiting concurrency in Python asyncio: the story of async imap_unordered() ✅ |
|
|
This article is a guide for experienced developers who need to do asynchronous processing many times, such as scraping data or calling an API multiple times. It discusses ways to limit the concurrency in asyncio to avoid loading everything in memory at once and overloading the services being called. The article covers various techniques such as:- asyncio.gather(),
- asyncio.Semaphore,
- asyncio.as_completed(),
- asyncio.Queue,
- asyncio.wait()
The article also highlights common issues and bugs that can arise with each technique and how to fix them. |
|
|
|
|