Examples¶
Practical examples in Jupyter Notebooks to learn DataFrameIt.
Available Notebooks¶
Examples are organized from basic to advanced. We recommend following in order.
1. Basic¶
Introduction to DataFrameIt with sentiment analysis.
- Create simple Pydantic model
- Process basic DataFrame
- Understand the output
from pydantic import BaseModel
from typing import Literal
class Sentiment(BaseModel):
sentiment: Literal['positive', 'negative', 'neutral']
2. Error Handling¶
How to handle errors and configure retry.
- Configure
max_retries,base_delay,max_delay - Check
_dataframeit_statuscolumn - Analyze
_error_details
3. Incremental Processing¶
Continue processing from where it stopped.
- Use
resume=True - Save and load partial results
- Reprocess only error rows
4. Custom Placeholder¶
Control where text appears in the prompt.
- Use
{texto}in template - Create complex multi-part prompts
5. Advanced Case: Legal Analysis¶
Real example with complex Pydantic model.
- Nested models
- Optional fields
- Lists of objects
- Multiple entity extraction
class Party(BaseModel):
name: str
type: Literal['plaintiff', 'defendant']
class Decision(BaseModel):
parties: List[Party]
outcome: Literal['granted', 'denied']
6. Polars¶
Use DataFrameIt with Polars instead of Pandas.
- Input with
polars.DataFrame - Output preserves Polars type
7. Multiple Data Types¶
Process different input types.
- Lists
- Dictionaries
- Series
8. Rate Limiting¶
Control request rate.
- Configure
rate_limit_delay - Use
parallel_requests - Combine for maximum efficiency
Running the Examples¶
1. Clone the Repository¶
2. Install Dependencies¶
3. Configure your API Key¶
4. Run Jupyter¶
Contributing Examples¶
If you created an interesting example, consider contributing! Open an issue or pull request on GitHub.