benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf f9c048c3-7dcd-5a51-ac3a-e365a2d0b024

Problem

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

complete prompt

import csv import collections def task_func(csv_file, emp_prefix='EMP$$'): """ Count the number of records for each employee in a CSV file. Parameters: csv_file (str): The path to the CSV file. This parameter is mandatory. emp_prefix (str): The prefix of the employee IDs. Default is 'EMP$$'. Returns: dict: A dictionary with the count of records for each employee. Requirements: - csv - collections Example: >>> counts = task_func('/path/to/file.csv') >>> print(counts) {'EMP$$001': 5, 'EMP$$002': 3} """
Plain-text mathematical notation (without MathML)
import csv
import collections

def task_func(csv_file, emp_prefix='EMP$$'):
    """
    Count the number of records for each employee in a CSV file.
    
    Parameters:
    csv_file (str): The path to the CSV file. This parameter is mandatory.
    emp_prefix (str): The prefix of the employee IDs. Default is 'EMP$$'.
    
    Returns:
    dict: A dictionary with the count of records for each employee.
    
    Requirements:
    - csv
    - collections
    
    Example:
    >>> counts = task_func('/path/to/file.csv')
    >>> print(counts)
    {'EMP$$001': 5, 'EMP$$002': 3}
    """
Original LaTeX notation
import csv
import collections

def task_func(csv_file, emp_prefix='EMP$$'):
    """
    Count the number of records for each employee in a CSV file.
    
    Parameters:
    csv_file (str): The path to the CSV file. This parameter is mandatory.
    emp_prefix (str): The prefix of the employee IDs. Default is 'EMP$$'.
    
    Returns:
    dict: A dictionary with the count of records for each employee.
    
    Requirements:
    - csv
    - collections
    
    Example:
    >>> counts = task_func('/path/to/file.csv')
    >>> print(counts)
    {'EMP$$001': 5, 'EMP$$002': 3}
    """

instruct prompt

Count the number of records for each employee in a CSV file.
The function should output with:
    dict: A dictionary with the count of records for each employee.
You should write self-contained code starting with:

Code

import csv
import collections
def task_func(csv_file, emp_prefix='EMP$$'):

code prompt

Code

import csv
import collections
def task_func(csv_file, emp_prefix='EMP$$'):

entry point

task_func

libs

  • csv
  • collections

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