benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 8133befd-2431-5add-b1de-df39e6293117

Problem

Answer published by the source. Consult the official source to check your work against its answer.

complete prompt

import sqlite3
import pandas as pd


def task_func(db_name, table_name):
    """
    Plot the relationship between the first and second numerical columns of an SQLite3 table, after excluding 'id' column.

    Parameters:
    - db_name (str): The absolute path to the SQLite3 database.
    - table_name (str): The name of the table to plot from.

    Returns:
    - matplotlib.axes._axes.Axes: Scatterplot with column name labeled on their respective axes.

    Raises:
    - ValueError: If the table has less than two numerical columns.
    
    Requirements:
    - sqlite3
    - pandas

    Example:
    >>> ax = task_func('/path/to/database/test.db', 'People')
    >>> type(ax)
    <class 'matplotlib.axes._axes.Axes'>
    >>> ax.get_xticklabels()
    [Text(0.9400000000000001, 0, '0.94'), ... ]
    """

instruct prompt

Plot the relationship between the first and second numerical columns of an SQLite3 table, after excluding 'id' column.
The function should raise the exception for: ValueError: If the table has less than two numerical columns.
The function should output with:
    matplotlib.axes._axes.Axes: Scatterplot with column name labeled on their respective axes.
You should write self-contained code starting with:

Code

import sqlite3
import pandas as pd
def task_func(db_name, table_name):

code prompt

Code

import sqlite3
import pandas as pd
def task_func(db_name, table_name):

entry point

task_func

libs

  • sqlite3
  • pandas

Discussion

Discussion

No discussion posts on this page yet. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

Source and history

Official source

initial import