benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf c989d7ec-9507-5fde-939d-41c82fb6c7e6

Problem

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

complete prompt

import numpy as np
import pandas as pd


def task_func(matrix1, matrix2):
    """
    Connects two 2D numeric arrays (matrices) along the second axis (columns),
    converts them into a Pandas DataFrame, and returns a string representation of the DataFrame.

    Parameters:
    - matrix1 (np.ndarray): The first 2D numpy array.
    - matrix2 (np.ndarray): The second 2D numpy array.

    Returns:
    - str: The string representation of the DataFrame without the index and header.

    Requirements:
    - pandas
    - numpy

    Example:
    >>> matrix1 = np.array([[1, 2, 3], [4, 5, 6]])
    >>> matrix2 = np.array([[7, 8, 9], [10, 11, 12]])
    >>> result = task_func(matrix1, matrix2)
    >>> all(x in result.replace(' ', '') for x in ['123789', '456101112'])
    True
    """

instruct prompt

Connects two 2D numeric arrays (matrices) along the second axis (columns), converts them into a Pandas DataFrame, and returns a string representation of the DataFrame.
The function should output with:
    str: The string representation of the DataFrame without the index and header.
You should write self-contained code starting with:

Code

import numpy as np
import pandas as pd
def task_func(matrix1, matrix2):

code prompt

Code

import numpy as np
import pandas as pd
def task_func(matrix1, matrix2):

entry point

task_func

libs

  • pandas
  • numpy

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