Bright Data: Collect Public Web Data in Real-time at Scale
Building AI apps capable of interacting with real-time web data can feel impossible. Here are the challenges:
You must simulate human-like interactions.
You must overcome site blocks and captchas.
You must scrape accurate and clean data at scale.
You must ensure compliance with all legal standards.
Bright Data provides the complete infrastructure to handle data extraction, user simulation, and real-time interactions for your AI apps across the web.
With Bright Data, you can:
Access clean data from any public website with ease.
Simulate user behaviors at scale using advanced browser-based tools.
Enable AI models to retrieve real-time insights with a seamless Search API.
Bright Data is the fastest way to take your AI apps to the next level.
Thanks to Bright Data for partnering today.
7 Uses of Underscore in Python
Underscore (_
) has so many usages in Python.
Today, I want to walk you through 7 of them.
#1) Retrieve the last computed value
You can retrieve the last computed value, as demonstrated below:
This works both in a script (.py
) and an interactive environment like Jupyter Notebook.
#2) Placeholder for loop variable
Instead of explicitly declaring a loop variable, you can also run loops as follows:
#3) Digit separator
When declaring large numbers, it can be difficult to interpret them. Underscore simplifies this:
#4-7) Declaring names
We can also use underscore while naming objects.
A single leading underscore is used to declare variables for internal use. Thus, they cannot be imported during wild imports (
from file import *
)
A single trailing underscore is used to avoid conflict with reserved keywords, as depicted below:
Double leading underscores are used to invoke name mangling. This way, one can prevent direct access to private variables outside a class:
Finally, double leading and trailing underscores, as you may already know, are used to define magic methods:
This is a guide on the 20 most common magic methods in Python:
Done!
These were the 7 elegant ways to use the underscore keyword in Python.
👉 Over to you: What other usages have I missed?
Thanks for reading!
P.S. For those wanting to develop “Industry ML” expertise:
At the end of the day, all businesses care about impact. That’s it!
Can you reduce costs?
Drive revenue?
Can you scale ML models?
Predict trends before they happen?
We have discussed several other topics (with implementations) in the past that align with such topics.
Here are some of them:
Learn sophisticated graph architectures and how to train them on graph data: A Crash Course on Graph Neural Networks – Part 1.
So many real-world NLP systems rely on pairwise context scoring. Learn scalable approaches here: Bi-encoders and Cross-encoders for Sentence Pair Similarity Scoring – Part 1.
Learn techniques to run large models on small devices: Quantization: Optimize ML Models to Run Them on Tiny Hardware.
Learn how to generate prediction intervals or sets with strong statistical guarantees for increasing trust: Conformal Predictions: Build Confidence in Your ML Model’s Predictions.
Learn how to identify causal relationships and answer business questions: A Crash Course on Causality – Part 1
Learn how to scale ML model training: A Practical Guide to Scaling ML Model Training.
Learn techniques to reliably roll out new models in production: 5 Must-Know Ways to Test ML Models in Production (Implementation Included)
Learn how to build privacy-first ML systems: Federated Learning: A Critical Step Towards Privacy-Preserving Machine Learning.
Learn how to compress ML models and reduce costs: Model Compression: A Critical Step Towards Efficient Machine Learning.
All these resources will help you cultivate key skills that businesses and companies care about the most.