tessl install tessl/pypi-tabulate@0.9.0Pretty-print tabular data in Python with extensive formatting options and output format support.
Agent Success
Agent success rate when using this tile
69%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.9x
Baseline
Agent success rate without this tile
77%
Build a Python program that generates formatted reports from datasets containing incomplete data. The program should handle missing values appropriately when creating tables.
Your program should read data from CSV files and generate formatted table reports that:
The program will read CSV files where some cells may be empty (representing missing data). For example:
Name,Age,Department,Salary
Alice,30,Engineering,75000
Bob,,Marketing,
Charlie,45,Engineering,85000
Dana,28,,62000The program should output a formatted table that:
Input CSV (employees_basic.csv):
Name,Score
Alice,95
Bob,
Charlie,87Expected behavior:
@test
Input CSV (employees_detailed.csv):
Name,Age,Salary
Alice,30,75000
Bob,,50000
Charlie,35,Expected behavior:
@test
@generates
def generate_report(csv_file_path: str, missing_placeholder: str = "N/A") -> str:
"""
Generate a formatted table report from a CSV file with missing value handling.
Args:
csv_file_path: Path to the CSV file to process
missing_placeholder: Placeholder text for missing values (default: "N/A")
Returns:
A formatted table as a string
"""
pass
def generate_report_with_column_placeholders(
csv_file_path: str,
column_placeholders: dict
) -> str:
"""
Generate a formatted table report with column-specific missing value placeholders.
Args:
csv_file_path: Path to the CSV file to process
column_placeholders: Dictionary mapping column names to their placeholder text
e.g., {"Age": "Unknown", "Salary": "Confidential"}
Returns:
A formatted table as a string
"""
passProvides table formatting functionality with support for handling missing values.