CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-tabulate

Pretty-print tabular data in Python with extensive formatting options and output format support.

Overall
score

69%

Overview
Eval results
Files

task.mdevals/scenario-1/

Data Type Analyzer

A tool that analyzes tabular data and reports the inferred data types for each column.

Capabilities

Parse and analyze tabular data

  • Given the data [[1, "text"], [2, "more"]], the analyzer returns {0: "int", 1: "str"} @test
  • Given the data [[1, 2.5], [2, 3.7]], the analyzer returns {0: "int", 1: "float"} @test
  • Given the data [[1, 2.5], [2.0, 3]] where column 0 mixes int and float, the analyzer returns {0: "float", 1: "float"} @test

Handle None values and edge cases

  • Given the data [[1, None], [2, "text"]], the analyzer ignores None and returns {0: "int", 1: "str"} @test
  • Given an empty table [], the analyzer returns an empty dictionary {} @test

Implementation

@generates

API

def analyze_column_types(data: list) -> dict:
    """
    Analyzes tabular data and returns the inferred type for each column.

    Args:
        data: A list of lists representing rows of tabular data.
              Each inner list represents a row with values for each column.

    Returns:
        A dictionary mapping column indices (0-based) to their inferred types.
        Possible type values: "int", "float", "str", "bool", "none"

    Raises:
        ValueError: If data is not a list or contains non-iterable rows.
    """
    pass

Dependencies { .dependencies }

tabulate { .dependency }

Provides table formatting and type inference capabilities.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/pypi-tabulate

tile.json