import numpy as np
a = np.array([[1,2],[3,4]])

result = ... # put solution in this variable

import numpy as np
import pandas as pd
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array([[1, 2], [3, 4]])
        elif test_case_id == 2:
            np.random.seed(42)
            dim1, dim2 = np.random.randint(1, 100, (2,))
            a = np.random.rand(dim1, dim2)
        elif test_case_id == 3:
            a = np.arange(24).reshape(2, 3, 4)
        elif test_case_id == 4:
            a = np.arange(100).reshape(2, 5, 5, 2)
        return a

    def generate_ans(data):
        _a = data
        a = _a
        result = a.shape
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(4):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
df = pd.DataFrame([[1,2],[3,4]])

result = ... # put solution in this variable

import numpy as np
import pandas as pd
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            df = pd.DataFrame([[1, 2], [3, 4]])
        elif test_case_id == 2:
            np.random.seed(42)
            dim1, dim2 = np.random.randint(1, 100, (2,))
            data = np.random.rand(dim1, dim2)
            df = pd.DataFrame(data)
        elif test_case_id == 3:
            data = np.arange(24).reshape(2, 3, 4)
            df = pd.DataFrame(data.reshape(6, 4))
        elif test_case_id == 4:
            data = np.arange(100).reshape(2, 5, 5, 2)
            df = pd.DataFrame(data.reshape(10, 10))
        return df

    def generate_ans(data):
        _df = data
        df = _df
        result = df.shape
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
df = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(4):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
x = np.array([1400, 1500, 1600, np.nan, np.nan, np.nan ,1700])

x = ... # put solution in this variable

import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            x = np.array([1400, 1500, 1600, np.nan, np.nan, np.nan, 1700])
        elif test_case_id == 2:
            np.random.seed(42)
            x = np.random.rand(20)
            x[np.random.randint(0, 20, 3)] = np.nan
        return x

    def generate_ans(data):
        _a = data
        x = _a
        x = x[~np.isnan(x)]
        return x

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
x = test_input
[insert]
result = x
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
x = pd.Series([1400, 1500, 1600, np.nan, np.nan, np.nan, 1700])

x = ... # put solution in this variable

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            x = pd.Series([1400, 1500, 1600, np.nan, np.nan, np.nan, 1700])
        elif test_case_id == 2:
            np.random.seed(42)
            x = pd.Series(np.random.rand(20))
            x.iloc[np.random.randint(0, 20, 3)] = np.nan
        return x

    def generate_ans(data):
        _a = data
        x = _a
        x = x.dropna()
        return x

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    pd.testing.assert_series_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
x = test_input
[insert]
result = x
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            x = np.array([1400, 1500, 1600, np.nan, np.nan, np.nan, 1700])
        elif test_case_id == 2:
            np.random.seed(42)
            x = np.random.rand(20)
            x[np.random.randint(0, 20, 3)] = np.nan
        return x

    def generate_ans(data):
        _a = data
        x = _a
        x[np.isnan(x)] = np.inf
        return x

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
x = test_input
[insert]
result = x
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            x = pd.Series([1400, 1500, 1600, np.nan, np.nan, np.nan, 1700])
        elif test_case_id == 2:
            np.random.seed(42)
            x = pd.Series(np.random.rand(20))
            x.iloc[np.random.randint(0, 20, 3)] = np.nan
        return x

    def generate_ans(data):
        _a = data
        x = _a
        x[x.isna()] = np.inf
        return x

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    pd.testing.assert_series_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
x = test_input
[insert]
result = x
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
x = np.array([[1400, 1500, 1600, np.nan], [1800, np.nan, np.nan ,1700]])

result = ... # put solution in this variable

import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            x = np.array([[1400, 1500, 1600, np.nan], [1800, np.nan, np.nan, 1700]])
        elif test_case_id == 2:
            x = np.array([[1, 2, np.nan], [3, np.nan, np.nan]])
        elif test_case_id == 3:
            x = np.array([[5, 5, np.nan, np.nan, 2], [3, 4, 5, 6, 7]])
        return x

    def generate_ans(data):
        _a = data
        x = _a
        result = [x[i, row] for i, row in enumerate(~np.isnan(x))]
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    for arr1, arr2 in zip(ans, result):
        np.testing.assert_array_equal(arr1, arr2)
    return 1

exec_context = r"""
import numpy as np
x = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(3):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
df = pd.DataFrame({'A': [1400, 1800], 'B': [1500, np.nan], 'C': [1600, np.nan], 'D': [np.nan, 1700]})

result = ... # put solution in this variable

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            df = pd.DataFrame({'A': [1400, 1800], 'B': [1500, np.nan], 'C': [1600, np.nan], 'D': [np.nan, 1700]})
        elif test_case_id == 2:
            df = pd.DataFrame({'A': [1, 3], 'B': [2, np.nan], 'C': [np.nan, np.nan]})
        elif test_case_id == 3:
            df = pd.DataFrame({'A': [5, 3], 'B': [5, 4], 'C': [np.nan, 5], 'D': [np.nan, 6], 'E': [2, 7]})
        return df

    def generate_ans(data):
        _a = data
        df = _a
        result = [df.iloc[i].dropna().tolist() for i in range(len(df))]
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    for arr1, arr2 in zip(ans, result):
        assert arr1 == arr2
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
df = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(3):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
a = np.array([1, 0, 3])

b = ... # put solution in this variable

b = np.zeros((a.size, a.max()+1))
b[np.arange(a.size), a]=1

import numpy as np
import copy
import tokenize, io

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array([1, 0, 3])
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.randint(0, 20, 50)
        return a

    def generate_ans(data):
        _a = data
        a = _a
        b = np.zeros((a.size, a.max() + 1))
        b[np.arange(a.size), a] = 1
        return b

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a = test_input
[insert]
result = b
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

def test_string(solution: str):
    tokens = []
    for token in tokenize.tokenize(io.BytesIO(solution.encode("utf-8")).readline):
        tokens.append(token.string)
    assert "while" not in tokens and "for" not in tokens

import pandas as pd
import numpy as np
series = pd.Series([1, 0, 3])

# Encode the series as a DataFrame where each row is a one-hot encoded version of the number in the series
df = ... # put solution in this variable

df = pd.DataFrame(np.zeros((series.size, series.max()+1)), columns=np.arange(series.max()+1))
df.loc[np.arange(series.size), series] = 1

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            series = pd.Series([1, 0, 3])
        elif test_case_id == 2:
            np.random.seed(42)
            series = pd.Series(np.random.randint(0, 20, 50))
        return series

    def generate_ans(data):
        _series = data
        df = pd.DataFrame(np.zeros((_series.size, _series.max() + 1)), columns=np.arange(_series.max() + 1))
        df.loc[np.arange(_series.size), _series] = 1
        return df

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def test_execution(solution: str):
    exec_context = r"""
import pandas as pd
import numpy as np
series = test_input
[insert]
result = df
"""
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        np.testing.assert_array_equal(test_env["result"].values, expected_result.values)


import numpy as np
a = np.array([-1, 0, 3])

b = ... # put solution in this variable

temp = a - a.min()
b = np.zeros((a.size, temp.max()+1))
b[np.arange(a.size), temp]=1

import numpy as np
import copy
import tokenize, io

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array([-1, 0, 3])
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.randint(-5, 20, 50)
        return a

    def generate_ans(data):
        _a = data
        a = _a
        temp = a - a.min()
        b = np.zeros((a.size, temp.max() + 1))
        b[np.arange(a.size), temp] = 1
        return b

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a = test_input
[insert]
result = b
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

def test_string(solution: str):
    tokens = []
    for token in tokenize.tokenize(io.BytesIO(solution.encode("utf-8")).readline):
        tokens.append(token.string)
    assert "while" not in tokens and "for" not in tokens

import pandas as pd
import numpy as np
series = pd.Series([-1, 0, 3])

# Encode the series into a one-hot DataFrame
df = ... # put solution in this variable

temp = series - series.min()
df = pd.DataFrame(np.zeros((series.size, temp.max()+1)), columns=range(series.min(), series.max()+1))
df.loc[np.arange(series.size), temp] = 1

import pandas as pd
import numpy as np
import copy
import tokenize, io

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            series = pd.Series([-1, 0, 3])
        elif test_case_id == 2:
            np.random.seed(42)
            series = pd.Series(np.random.randint(-5, 20, 50))
        return series

    def generate_ans(data):
        temp = data - data.min()
        df = pd.DataFrame(np.zeros((data.size, temp.max() + 1)), columns=range(data.min(), data.max() + 1))
        df.loc[np.arange(data.size), temp] = 1
        return df

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        np.testing.assert_array_equal(test_env["result"].values, expected_result.values)

exec_context = r"""
import pandas as pd
import numpy as np
series = test_input
[insert]
result = df
"""


import numpy as np
a = np.array([[1,0,3], [2,4,1]])

b = ... # put solution in this variable

temp = (a - a.min()).ravel()
b = np.zeros((a.size, temp.max()+1))
b[np.arange(a.size), temp]=1

import numpy as np
import copy
import tokenize, io

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array([[1, 0, 3], [2, 4, 1]])
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.randint(0, 20, (10, 20))
        return a

    def generate_ans(data):
        _a = data
        a = _a
        temp = (a - a.min()).ravel()
        b = np.zeros((a.size, temp.max() + 1))
        b[np.arange(a.size), temp] = 1
        return b

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a = test_input
[insert]
result = b
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

def test_string(solution: str):
    tokens = []
    for token in tokenize.tokenize(io.BytesIO(solution.encode("utf-8")).readline):
        tokens.append(token.string)
    assert "while" not in tokens and "for" not in tokens

import pandas as pd
import numpy as np

a = pd.DataFrame([[1,0,3], [2,4,1]])

b = ... # put solution in this variable

temp = (a.values - a.values.min()).ravel()
b = np.zeros((a.size, temp.max()+1))
b[np.arange(a.size), temp]=1
b = pd.DataFrame(b)

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = pd.DataFrame([[1, 0, 3], [2, 4, 1]])
        elif test_case_id == 2:
            np.random.seed(42)
            a = pd.DataFrame(np.random.randint(0, 20, (10, 20)))
        return a

    def generate_ans(data):
        _a = data
        a = _a
        temp = (a.values - a.values.min()).ravel()
        b = np.zeros((a.size, temp.max() + 1))
        b[np.arange(a.size), temp] = 1
        return pd.DataFrame(b)

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        np.testing.assert_array_equal(test_env["result"].values, expected_result.values)

exec_context = r"""
import pandas as pd
import numpy as np
a = test_input
[insert]
result = b
"""


import numpy as np
a = np.array([1,2,3,4,5])
p = 25

result = ... # put solution in this variable

import numpy as np
import pandas as pd
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array([1, 2, 3, 4, 5])
            p = 25
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.rand(20)
            p = np.random.randint(1, 99)
        return a, p

    def generate_ans(data):
        _a = data
        a, p = _a
        result = np.percentile(a, p)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_allclose(result, ans)
    return 1

exec_context = r"""
import numpy as np
a, p = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import numpy as np
import pandas as pd
a = pd.Series([1,2,3,4,5])
p = 25

result = ... # put solution in this variable

import numpy as np
import pandas as pd
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = pd.Series([1, 2, 3, 4, 5])
            p = 25
        elif test_case_id == 2:
            np.random.seed(42)
            a = pd.Series(np.random.rand(20))
            p = np.random.randint(1, 99)
        return a, p

    def generate_ans(data):
        _a = data
        a, p = _a
        result = np.percentile(a, p)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_allclose(result, ans)
    return 1

exec_context = r"""
import numpy as np
import pandas as pd
a, p = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
A = np.array([1,2,3,4,5,6])
ncol = 2

B = ... # put solution in this variable

import numpy as np
import pandas as pd
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            A = np.array([1, 2, 3, 4, 5, 6])
            ncol = 2
        elif test_case_id == 2:
            np.random.seed(42)
            A = np.random.rand(20)
            ncol = 5
        return A, ncol

    def generate_ans(data):
        _a = data
        A, ncol = _a
        B = np.reshape(A, (-1, ncol))
        return B

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
A, ncol = test_input
[insert]
result = B
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
A = pd.Series([1,2,3,4,5,6])
ncol = 2

B = ... # put solution in this variable

B = pd.DataFrame(A.values.reshape(-1, ncol))

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            A = pd.Series([1, 2, 3, 4, 5, 6])
            ncol = 2
        elif test_case_id == 2:
            np.random.seed(42)
            A = pd.Series(np.random.rand(20))
            ncol = 5
        return A, ncol

    def generate_ans(data):
        _a = data
        A, ncol = _a
        B = A.values.reshape(-1, ncol)
        return pd.DataFrame(B)

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    pd.testing.assert_frame_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
A, ncol = test_input
[insert]
result = B
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
A = np.array([1,2,3,4,5,6])
nrow = 3

B = ... # put solution in this variable

import numpy as np
import pandas as pd
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            A = np.array([1, 2, 3, 4, 5, 6])
            nrow = 2
        elif test_case_id == 2:
            np.random.seed(42)
            A = np.random.rand(20)
            nrow = 5
        return A, nrow

    def generate_ans(data):
        _a = data
        A, nrow = _a
        B = np.reshape(A, (nrow, -1))
        return B

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
A, nrow = test_input
[insert]
result = B
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
A = pd.Series([1,2,3,4,5,6])
nrow = 3

B = ... # put solution in this variable

B = pd.DataFrame(A.values.reshape(nrow, -1))

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            A = pd.Series([1, 2, 3, 4, 5, 6])
            nrow = 2
        elif test_case_id == 2:
            np.random.seed(42)
            A = pd.Series(np.random.rand(20))
            nrow = 5
        return A, nrow

    def generate_ans(data):
        _a = data
        A, nrow = _a
        B = A.values.reshape(nrow, -1)
        B = pd.DataFrame(B)
        return B

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    pd.testing.assert_frame_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
A, nrow = test_input
[insert]
result = B
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
A = np.array([1,2,3,4,5,6,7])
ncol = 2

B = ... # put solution in this variable

col = ( A.shape[0] // ncol) * ncol
B = A[:col]
B= np.reshape(B, (-1, ncol))

import numpy as np
import pandas as pd
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            A = np.array([1, 2, 3, 4, 5, 6, 7])
            ncol = 2
        elif test_case_id == 2:
            np.random.seed(42)
            A = np.random.rand(23)
            ncol = 5
        return A, ncol

    def generate_ans(data):
        _a = data
        A, ncol = _a
        col = (A.shape[0] // ncol) * ncol
        B = A[:col]
        B = np.reshape(B, (-1, ncol))
        return B

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
A, ncol = test_input
[insert]
result = B
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
S = pd.Series([1,2,3,4,5,6,7])
ncol = 2

df = ... # put solution in this variable

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            S = pd.Series([1, 2, 3, 4, 5, 6, 7])
            ncol = 2
        elif test_case_id == 2:
            np.random.seed(42)
            S = pd.Series(np.random.rand(23))
            ncol = 5
        return S, ncol

    def generate_ans(data):
        _s = data
        S, ncol = _s
        col = (S.shape[0] // ncol) * ncol
        df = S.iloc[:col].values.reshape(-1, ncol)
        df = pd.DataFrame(df)
        return df

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    pd.testing.assert_frame_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
S, ncol = test_input
[insert]
result = df
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


col = ( A.shape[0] // ncol) * ncol
B = A[len(A)-col:][::-1]
B = np.reshape(B, (-1, ncol))

import numpy as np
import pandas as pd
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            A = np.array([1, 2, 3, 4, 5, 6, 7])
            ncol = 2
        elif test_case_id == 2:
            np.random.seed(42)
            A = np.random.rand(23)
            ncol = 5
        return A, ncol

    def generate_ans(data):
        _a = data
        A, ncol = _a
        col = (A.shape[0] // ncol) * ncol
        B = A[len(A) - col :][::-1]
        B = np.reshape(B, (-1, ncol))
        return B

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
A, ncol = test_input
[insert]
result = B
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
S = pd.Series([1,2,3,4,5,6,7])
ncol = 2

D = ... # put solution in this variable

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            S = pd.Series([1, 2, 3, 4, 5, 6, 7])
            ncol = 2
        elif test_case_id == 2:
            np.random.seed(42)
            S = pd.Series(np.random.rand(23))
            ncol = 5
        return S, ncol

    def generate_ans(data):
        _s = data
        S, ncol = _s
        col = (S.size // ncol) * ncol
        D = S.iloc[-col:][::-1]
        D = pd.DataFrame(D.values.reshape(-1, ncol))
        return D

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    pd.testing.assert_frame_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
S, ncol = test_input
[insert]
result = D
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
a = np.array([ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9.])
shift = 3

result = ... # put solution in this variable

import numpy as np
import pandas as pd
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array([0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0])
            shift = 3
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.rand(100)
            shift = np.random.randint(-99, 0)
        return a, shift

    def generate_ans(data):
        _a = data
        a, shift = _a

        def solution(xs, n):
            e = np.empty_like(xs)
            if n >= 0:
                e[:n] = np.nan
                e[n:] = xs[:-n]
            else:
                e[n:] = np.nan
                e[:n] = xs[-n:]
            return e

        result = solution(a, shift)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a, shift = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
a = pd.Series([0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
shift = 3

result = ... # put solution in this variable

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = pd.Series([0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0])
            shift = 3
        elif test_case_id == 2:
            np.random.seed(42)
            a = pd.Series(np.random.rand(100))
            shift = np.random.randint(-99, 0)
        return a, shift

    def generate_ans(data):
        _a = data
        a, shift = _a
        result = a.shift(shift)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    pd.testing.assert_series_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
a, shift = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


def solution(xs, n):
    e = np.empty_like(xs)
    if n >= 0:
        e[:,:n] = np.nan
        e[:,n:] = xs[:,:-n]
    else:
        e[:,n:] = np.nan
        e[:,:n] = xs[:,-n:]
    return e
result = solution(a, shift)

import numpy as np
import pandas as pd
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array(
                [
                    [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0],
                    [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0],
                ]
            )
            shift = 3
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.rand(10, 100)
            shift = np.random.randint(-99, 0)
        return a, shift

    def generate_ans(data):
        _a = data
        a, shift = _a

        def solution(xs, n):
            e = np.empty_like(xs)
            if n >= 0:
                e[:, :n] = np.nan
                e[:, n:] = xs[:, :-n]
            else:
                e[:, n:] = np.nan
                e[:, :n] = xs[:, -n:]
            return e

        result = solution(a, shift)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a, shift = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
df = pd.DataFrame([[0., 1., 2., 3., 4., 5., 6., 7., 8., 9.], [1., 2., 3., 4., 5., 6., 7., 8., 9., 10.]])
shift = 3

result = ... # put solution in this variable

result = df.shift(periods=shift, axis=1)
result.fillna(value=np.nan, inplace=True)

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            df = pd.DataFrame([[0., 1., 2., 3., 4., 5., 6., 7., 8., 9.], [1., 2., 3., 4., 5., 6., 7., 8., 9., 10.]])
            shift = 3
        elif test_case_id == 2:
            np.random.seed(42)
            data = np.random.rand(10, 100)
            df = pd.DataFrame(data)
            shift = np.random.randint(-99, 0)
        return df, shift

    def generate_ans(data):
        _df, shift = data
        result = _df.shift(periods=shift, axis=1)
        result.fillna(value=np.nan, inplace=True)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    pd.testing.assert_frame_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
df, shift = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


def solution(xs, shift):
    e = np.empty_like(xs)
    for i, n in enumerate(shift):
        if n >= 0:
            e[i,:n] = np.nan
            e[i,n:] = xs[i,:-n]
        else:
            e[i,n:] = np.nan
            e[i,:n] = xs[i,-n:]
    return e
result = solution(a, shift)

import numpy as np
import pandas as pd
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array(
                [
                    [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0],
                    [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0],
                ]
            )
            shift = [-2, 3]
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.rand(10, 100)
            shift = np.random.randint(-99, 99, (10,))
        return a, shift

    def generate_ans(data):
        _a = data
        a, shift = _a

        def solution(xs, shift):
            e = np.empty_like(xs)
            for i, n in enumerate(shift):
                if n >= 0:
                    e[i, :n] = np.nan
                    e[i, n:] = xs[i, :-n]
                else:
                    e[i, n:] = np.nan
                    e[i, :n] = xs[i, -n:]
            return e

        result = solution(a, shift)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a, shift = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

def solution(df, shift):
    for i, n in enumerate(shift):
        df.iloc[i] = df.iloc[i].shift(n)
        if n > 0:
            df.iloc[i, :n] = np.nan
        else:
            df.iloc[i, n:] = np.nan
    return df
result = solution(df, shift)

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            df = pd.DataFrame({
                'A': [0.0, 1.0],
                'B': [1.0, 2.0],
                'C': [2.0, 3.0],
                'D': [3.0, 4.0],
                'E': [4.0, 5.0],
                'F': [5.0, 6.0],
                'G': [6.0, 7.0],
                'H': [7.0, 8.0],
                'I': [8.0, 9.0],
                'J': [9.0, 10.0]
            })
            shift = [-2, 3]
        elif test_case_id == 2:
            np.random.seed(42)
            data = np.random.rand(10, 100)
            df = pd.DataFrame(data)
            shift = np.random.randint(-99, 99, (10,))
        return df, shift

    def generate_ans(data):
        df, shift = data

        def solution(df, shift):
            for i, n in enumerate(shift):
                df.iloc[i] = df.iloc[i].shift(n)
                if n > 0:
                    df.iloc[i, :n] = np.nan
                else:
                    df.iloc[i, n:] = np.nan
            return df

        result = solution(df.copy(), shift)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    pd.testing.assert_frame_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
df, shift = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
a = np.array([[10,50,30],[60,20,40]])

result = ... # put solution in this variable

import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array([[10, 50, 30], [60, 20, 40]])
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.rand(np.random.randint(5, 10), np.random.randint(6, 10))
        return a

    def generate_ans(data):
        _a = data
        a = _a
        result = a.argmax()
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
df = pd.DataFrame([[10,50,30],[60,20,40]])

result = ... # put solution in this variable

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            df = pd.DataFrame([[10, 50, 30], [60, 20, 40]])
        elif test_case_id == 2:
            np.random.seed(42)
            data = np.random.rand(np.random.randint(5, 10), np.random.randint(6, 10))
            df = pd.DataFrame(data)
        return df

    def generate_ans(data):
        _df = data
        df = _df
        result = df.values.argmax()
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
df = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array([[10, 50, 30], [60, 20, 40]])
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.rand(np.random.randint(5, 10), np.random.randint(6, 10))
        return a

    def generate_ans(data):
        _a = data
        a = _a
        result = a.argmin()
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            df = pd.DataFrame([[10, 50, 30], [60, 20, 40]])
        elif test_case_id == 2:
            np.random.seed(42)
            data = np.random.rand(np.random.randint(5, 10), np.random.randint(6, 10))
            df = pd.DataFrame(data)
        return df

    def generate_ans(data):
        _df = data
        df = _df
        result = df.values.argmin()
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
df = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array([[10, 50, 30], [60, 20, 40]])
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.rand(np.random.randint(5, 10), np.random.randint(6, 10))
        return a

    def generate_ans(data):
        _a = data
        a = _a
        result = np.unravel_index(a.argmax(), a.shape)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            df = pd.DataFrame([[10, 50, 30], [60, 20, 40]])
        elif test_case_id == 2:
            np.random.seed(42)
            data = np.random.rand(np.random.randint(5, 10), np.random.randint(6, 10))
            df = pd.DataFrame(data)
        return df

    def generate_ans(data):
        _df = data
        df = _df
        result = df.stack().idxmax()
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert result == ans
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
df = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array([[10, 50, 30], [60, 20, 40]])
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.rand(np.random.randint(5, 10), np.random.randint(6, 10))
        return a

    def generate_ans(data):
        _a = data
        a = _a
        idx = np.unravel_index(a.argmax(), a.shape)
        a[idx] = a.min()
        result = np.unravel_index(a.argmax(), a.shape)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            df = pd.DataFrame([[10, 50, 30], [60, 20, 40]])
        elif test_case_id == 2:
            np.random.seed(42)
            data = np.random.rand(np.random.randint(5, 10), np.random.randint(6, 10))
            df = pd.DataFrame(data)
        return df

    def generate_ans(data):
        _df = data
        df = _df
        idx = df.stack().idxmax()
        df.at[idx] = df.min().min()
        result = df.stack().idxmax()
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert result == ans
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
df = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
a = np.array([[np.nan, 2., 3., np.nan],
		[1., 2., 3., 9]])

a = ... # put solution in this variable

z = np.any(np.isnan(a), axis = 0)
a = a[:, ~z]

import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array([[np.nan, 2.0, 3.0, np.nan], [1.0, 2.0, 3.0, 9]])
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.rand(np.random.randint(5, 10), np.random.randint(6, 10))
            for i in range(5):
                x, y = np.random.randint(1, 4, (2,))
                a[x][y] = np.nan
        return a

    def generate_ans(data):
        _a = data
        a = _a
        z = np.any(np.isnan(a), axis=0)
        a = a[:, ~z]
        return a

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a = test_input
[insert]
result = a
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
df = pd.DataFrame({
    'A': [np.nan, 1],
    'B': [2, 2],
    'C': [3, 3],
    'D': [np.nan, 9]
})

# Your code here to modify 'df'

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            df = pd.DataFrame({
                'A': [np.nan, 1],
                'B': [2, 2],
                'C': [3, 3],
                'D': [np.nan, 9]
            })
        elif test_case_id == 2:
            np.random.seed(42)
            data = np.random.rand(np.random.randint(5, 10), np.random.randint(4, 8))
            df = pd.DataFrame(data, columns=[chr(65+i) for i in range(data.shape[1])])
            for i in range(5):
                x, y = np.random.randint(0, df.shape[0]), np.random.randint(0, df.shape[1])
                df.iat[x, y] = np.nan
        return df

    def generate_ans(data):
        df = data
        df = df.loc[:, ~df.isna().any()]
        return df

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    pd.testing.assert_frame_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
df = test_input
[insert]
result = df
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


z = np.any(np.isnan(a), axis = 1)
a = a[~z, :]

import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array([[np.nan, 2.0, 3.0, np.nan], [1.0, 2.0, 3.0, 9]])
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.rand(np.random.randint(5, 10), np.random.randint(6, 10))
            for i in range(5):
                x, y = np.random.randint(1, 4, (2,))
                a[x][y] = np.nan
        return a

    def generate_ans(data):
        _a = data
        a = _a
        z = np.any(np.isnan(a), axis=1)
        a = a[~z, :]
        return a

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a = test_input
[insert]
result = a
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np

df = pd.DataFrame({
    'A': [np.nan, 1],
    'B': [2, 2],
    'C': [3, 3],
    'D': [np.nan, 9]
})

df = ... # put solution in this variable

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            df = pd.DataFrame({'A': [np.nan, 1], 'B': [2, 2], 'C': [3, 3], 'D': [np.nan, 9]})
        elif test_case_id == 2:
            np.random.seed(42)
            data = np.random.rand(np.random.randint(5, 10), np.random.randint(4, 8))
            df = pd.DataFrame(data, columns=list('ABCD'[:data.shape[1]]))
            for i in range(5):
                x = np.random.randint(0, df.shape[0])
                y = np.random.choice(df.columns)
                df.at[x, y] = np.nan
        return df

    def generate_ans(data):
        df = data
        df = df.dropna()
        return df

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    pd.testing.assert_frame_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
df = test_input
[insert]
result = df
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]

result = ... # put solution in this variable

import numpy as np
import pandas as pd
import copy
import tokenize, io

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.rand(10, 20, 5).tolist()
        return a

    def generate_ans(data):
        _a = data
        a = _a
        result = np.array(a)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert type(result) == type(ans)
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

def test_string(solution: str):
    tokens = []
    for token in tokenize.tokenize(io.BytesIO(solution.encode("utf-8")).readline):
        tokens.append(token.string)
    assert "while" not in tokens and "for" not in tokens

import pandas as pd
import numpy as np
a = [{'col1': 1, 'col2': 2, 'col3': 3}, {'col1': 4, 'col2': 5, 'col3': 6}, {'col1': 7, 'col2': 8, 'col3': 9}]

result = ... # put solution in this variable

import pandas as pd
import numpy as np
import copy
import tokenize, io

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = [{'col1': 1, 'col2': 2, 'col3': 3}, {'col1': 4, 'col2': 5, 'col3': 6}, {'col1': 7, 'col2': 8, 'col3': 9}]
        elif test_case_id == 2:
            np.random.seed(42)
            a = [{'col1': x, 'col2': y, 'col3': z} for x, y, z in zip(np.random.rand(100), np.random.rand(100), np.random.rand(100))]
        return a

    def generate_ans(data):
        _a = data
        a = _a
        result = pd.DataFrame(a)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    pd.testing.assert_frame_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
a = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

def test_string(solution: str):
    tokens = []
    for token in tokenize.tokenize(io.BytesIO(solution.encode("utf-8")).readline):
        tokens.append(token.string)
    assert "while" not in tokens and "for" not in tokens


import numpy as np
a = np.array([[1, 2], [3, 0]])

result = ... # put solution in this variable

import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array([[1, 2], [3, 0]])
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.rand(5, 6)
        return a

    def generate_ans(data):
        _a = data
        a = _a
        result = np.unravel_index(a.argmin(), a.shape)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
df = pd.DataFrame([[1, 2], [3, 0]])

result = ... # put solution in this variable

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            df = pd.DataFrame([[1, 2], [3, 0]])
        elif test_case_id == 2:
            np.random.seed(42)
            data = np.random.rand(5, 6)
            df = pd.DataFrame(data)
        return df

    def generate_ans(data):
        _df = data
        df = _df
        result = np.unravel_index(df.values.argmin(), df.shape)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
df = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array([[1, 2], [3, 0]])
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.rand(5, 6)
        return a

    def generate_ans(data):
        _a = data
        a = _a
        result = np.unravel_index(a.argmax(), a.shape)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            df = pd.DataFrame([[1, 2], [3, 0]])
        elif test_case_id == 2:
            np.random.seed(42)
            data = np.random.rand(5, 6)
            df = pd.DataFrame(data)
        return df

    def generate_ans(data):
        _df = data
        df = _df
        result = np.unravel_index(df.to_numpy().argmax(), df.shape)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
df = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
a = np.array([[1, 0], [0, 2]])

result = ... # put solution in this variable

import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array([[1, 2], [0, 0]])
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.randint(1, 5, (5, 6))
        elif test_case_id == 3:
            a = np.array([[1, 0], [0, 2]])
        return a

    def generate_ans(data):
        _a = data
        a = _a
        result = np.argwhere(a == np.min(a))
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(3):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
df = pd.DataFrame([[1, 0], [0, 2]])

result = ... # put solution in this variable

result = np.argwhere(df.values == df.values.min())

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            df = pd.DataFrame([[1, 2], [0, 0]])
        elif test_case_id == 2:
            np.random.seed(42)
            data = np.random.randint(1, 5, (5, 6))
            df = pd.DataFrame(data)
        elif test_case_id == 3:
            df = pd.DataFrame([[1, 0], [0, 2]])
        return df

    def generate_ans(data):
        _df = data
        result = np.argwhere(_df.values == _df.values.min())
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
df = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(3):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
degree = 90

result = ... # put solution in this variable

import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            degree = 90
        elif test_case_id == 2:
            np.random.seed(42)
            degree = np.random.randint(0, 360)
        return degree

    def generate_ans(data):
        _a = data
        degree = _a
        result = np.sin(np.deg2rad(degree))
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert np.allclose(result, ans)
    return 1

exec_context = r"""
import numpy as np
degree = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

df = pd.DataFrame({'angle_degrees': [0, 30, 45, 60, 90]})

import pandas as pd
import numpy as np

data = pd.DataFrame({'angle': [90]})

result = ... # put solution in this variable

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            data = pd.DataFrame({'angle': [90]})
        elif test_case_id == 2:
            np.random.seed(42)
            angles = np.random.randint(0, 360, size=5)
            data = pd.DataFrame({'angle': angles})
        return data

    def generate_ans(data):
        result = np.sin(np.deg2rad(data['angle']))
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert np.allclose(result, ans)
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
data = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            degree = 90
        elif test_case_id == 2:
            np.random.seed(42)
            degree = np.random.randint(0, 360)
        return degree

    def generate_ans(data):
        _a = data
        degree = _a
        result = np.cos(np.deg2rad(degree))
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert np.allclose(result, ans)
    return 1

exec_context = r"""
import numpy as np
degree = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

df = pd.DataFrame({'angle_degrees': [0, 30, 60, 90]})

import pandas as pd
import numpy as np

degree = pd.Series([90])

result = ... # put solution in this variable

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            degree = pd.Series([90])
        elif test_case_id == 2:
            np.random.seed(42)
            degree = pd.Series(np.random.randint(0, 360, size=5))
        return degree

    def generate_ans(data):
        _a = data
        result = np.cos(np.deg2rad(_a))
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert np.allclose(result, ans)
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
degree = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
number = np.random.randint(0, 360)

result = ... # put solution in this variable

import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            number = 4
        elif test_case_id == 2:
            np.random.seed(43)
            number = np.random.randint(0, 360)
        elif test_case_id == 3:
            np.random.seed(142)
            number = np.random.randint(0, 360)
        return number

    def generate_ans(data):
        _a = data
        number = _a
        deg = np.sin(np.deg2rad(number))
        rad = np.sin(number)
        result = int(rad > deg)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert result == ans
    return 1

exec_context = r"""
import numpy as np
number = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(3):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
number = pd.Series([np.random.randint(0, 360)])

result = ... # put solution in this variable

number = number.iloc[0]
deg = np.sin(np.deg2rad(number))
rad = np.sin(number)
result = int(rad > deg)

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            number = pd.Series([4])
        elif test_case_id == 2:
            np.random.seed(43)
            number = pd.Series([np.random.randint(0, 360)])
        elif test_case_id == 3:
            np.random.seed(142)
            number = pd.Series([np.random.randint(0, 360)])
        return number

    def generate_ans(data):
        number = data.iloc[0]
        deg = np.sin(np.deg2rad(number))
        rad = np.sin(number)
        result = int(rad > deg)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert result == ans
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
number = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(3):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
value = 1.0

result = ... # put solution in this variable

import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            value = 1.0
        elif test_case_id == 2:
            np.random.seed(42)
            value = (np.random.rand() - 0.5) * 2
        return value

    def generate_ans(data):
        _a = data
        value = _a
        result = np.degrees(np.arcsin(value))
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert np.allclose(result, ans)
    return 1

exec_context = r"""
import numpy as np
value = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
value = pd.Series([1.0])

result = ... # put solution in this variable

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            value = pd.Series([1.0])
        elif test_case_id == 2:
            np.random.seed(42)
            value = pd.Series([(np.random.rand() - 0.5) * 2])
        return value

    def generate_ans(data):
        value = data
        result = np.degrees(np.arcsin(value))
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert np.allclose(result, ans)
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
value = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
a = np.arange(4).reshape(2, 2)
power = 5

a = ... # put solution in this variable

import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.arange(4).reshape(2, 2)
            power = 5
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.rand(np.random.randint(5, 10), np.random.randint(6, 10))
            power = np.random.randint(6, 10)
        return a, power

    def generate_ans(data):
        _a = data
        a, power = _a
        a = a**power
        return a

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert np.allclose(result, ans)
    return 1

exec_context = r"""
import numpy as np
a, power = test_input
[insert]
result = a
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
df = pd.DataFrame(np.arange(4).reshape(2, 2))
power = 5

df = ... # put solution in this variable

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            df = pd.DataFrame(np.arange(4).reshape(2, 2))
            power = 5
        elif test_case_id == 2:
            np.random.seed(42)
            data = np.random.rand(np.random.randint(5, 10), np.random.randint(6, 10))
            df = pd.DataFrame(data)
            power = np.random.randint(6, 10)
        return df, power

    def generate_ans(data):
        _df = data
        df, power = _df
        df = df ** power
        return df

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert np.allclose(result, ans)
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
df, power = test_input
[insert]
result = df
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
example_a = np.arange(4).reshape(2, 2)
def f(a = example_a, power = 5):
    # return the solution in this function
    # result = f(a, power)
    ###

    result = a ** power

    return result

import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.arange(4).reshape(2, 2)
            power = 5
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.rand(np.random.randint(5, 10), np.random.randint(6, 10))
            power = np.random.randint(6, 10)
        return a, power

    def generate_ans(data):
        _a = data
        a, power = _a
        result = a**power
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert np.allclose(result, ans)
    return 1

exec_context = r"""
import numpy as np
a, power = test_input
def f(a, power):
[insert]
result = f(a, power)
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
example_a = pd.DataFrame(np.arange(4).reshape(2, 2))
def f(a = example_a, power = 5):
    # return the solution in this function
    # result = f(a, power)
    ###

    result = a ** power

    return result

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = pd.DataFrame(np.arange(4).reshape(2, 2))
            power = 5
        elif test_case_id == 2:
            np.random.seed(42)
            a = pd.DataFrame(np.random.rand(np.random.randint(5, 10), np.random.randint(6, 10)))
            power = np.random.randint(6, 10)
        return a, power

    def generate_ans(data):
        _a = data
        a, power = _a
        result = a**power
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert np.allclose(result, ans)
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
a, power = test_input
def f(a, power):
[insert]
result = f(a, power)
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


gcd = np.gcd(numerator, denominator)
result = (numerator//gcd, denominator//gcd)

import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            numerator = 98
            denominator = 42
        elif test_case_id == 2:
            np.random.seed(42)
            numerator = np.random.randint(2, 10)
            denominator = np.random.randint(2, 10)
        elif test_case_id == 3:
            numerator = -5
            denominator = 10
        return numerator, denominator

    def generate_ans(data):
        _a = data
        numerator, denominator = _a
        gcd = np.gcd(numerator, denominator)
        result = (numerator // gcd, denominator // gcd)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert result[0] == ans[0] and result[1] == ans[1]
    return 1

exec_context = r"""
import numpy as np
numerator, denominator = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(3):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
numerator = 98
denominator = 42

result = ... # put solution in this variable

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            numerator = 98
            denominator = 42
        elif test_case_id == 2:
            np.random.seed(42)
            numerator = np.random.randint(2, 10)
            denominator = np.random.randint(2, 10)
        elif test_case_id == 3:
            numerator = -5
            denominator = 10
        return numerator, denominator

    def generate_ans(data):
        _a = data
        numerator, denominator = _a
        gcd = np.gcd(numerator, denominator)
        result = (numerator // gcd, denominator // gcd)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert result[0] == ans[0] and result[1] == ans[1]
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
numerator, denominator = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(3):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


    gcd = np.gcd(numerator, denominator)
    result = (numerator//gcd, denominator//gcd)

    return result

import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            numerator = 98
            denominator = 42
        elif test_case_id == 2:
            np.random.seed(42)
            numerator = np.random.randint(2, 10)
            denominator = np.random.randint(2, 10)
        elif test_case_id == 3:
            numerator = -5
            denominator = 10
        return numerator, denominator

    def generate_ans(data):
        _a = data
        numerator, denominator = _a
        gcd = np.gcd(numerator, denominator)
        result = (numerator // gcd, denominator // gcd)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert result[0] == ans[0] and result[1] == ans[1]
    return 1

exec_context = r"""
import numpy as np
numerator, denominator = test_input
def f(numerator, denominator):
[insert]
result = f(numerator, denominator)
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(3):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np

def f(numerator = 98, denominator = 42):
    # return the solution in this function
    # result = f(numerator, denominator)
    ###

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            numerator = 98
            denominator = 42
        elif test_case_id == 2:
            np.random.seed(42)
            numerator = np.random.randint(2, 10)
            denominator = np.random.randint(2, 10)
        elif test_case_id == 3:
            numerator = -5
            denominator = 10
        return numerator, denominator

    def generate_ans(data):
        _a = data
        numerator, denominator = _a
        gcd = np.gcd(numerator, denominator)
        result = (numerator // gcd, denominator // gcd)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    assert result[0] == ans[0] and result[1] == ans[1]
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
numerator, denominator = test_input
def f(numerator, denominator):
[insert]
result = f(numerator, denominator)
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(3):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


if denominator == 0:
    result = (np.nan, np.nan)
else:
    gcd = np.gcd(numerator, denominator)
    result = (numerator//gcd, denominator//gcd)

import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            numerator = 98
            denominator = 42
        elif test_case_id == 2:
            np.random.seed(42)
            numerator = np.random.randint(2, 10)
            denominator = np.random.randint(2, 10)
        elif test_case_id == 3:
            numerator = -5
            denominator = 10
        elif test_case_id == 4:
            numerator = 5
            denominator = 0
        return numerator, denominator

    def generate_ans(data):
        _a = data
        numerator, denominator = _a
        if denominator == 0:
            result = (np.nan, np.nan)
        else:
            gcd = np.gcd(numerator, denominator)
            result = (numerator // gcd, denominator // gcd)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    if np.isnan(ans[0]):
        assert np.isnan(result[0]) and np.isnan(result[1])
    else:
        assert result[0] == ans[0] and result[1] == ans[1]
    return 1

exec_context = r"""
import numpy as np
numerator, denominator = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(4):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            numerator = 98
            denominator = 42
        elif test_case_id == 2:
            np.random.seed(42)
            numerator = np.random.randint(2, 10)
            denominator = np.random.randint(2, 10)
        elif test_case_id == 3:
            numerator = -5
            denominator = 10
        elif test_case_id == 4:
            numerator = 5
            denominator = 0
        return numerator, denominator

    def generate_ans(data):
        _a = data
        numerator, denominator = _a
        if denominator == 0:
            result = (np.nan, np.nan)
        else:
            gcd = np.gcd(numerator, denominator)
            result = (numerator // gcd, denominator // gcd)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    if np.isnan(ans[0]):
        assert np.isnan(result[0]) and np.isnan(result[1])
    else:
        assert result[0] == ans[0] and result[1] == ans[1]
    return 1

exec_context = r"""
import pandas as pd
import numpy as np
numerator, denominator = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(4):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
a = np.array([10, 20, 30])
b = np.array([30, 20, 20])
c = np.array([50, 20, 40])

result = ... # put solution in this variable

import numpy as np
import pandas as pd
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array([10, 20, 30])
            b = np.array([30, 20, 20])
            c = np.array([50, 20, 40])
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.rand(50)
            b = np.random.rand(50)
            c = np.random.rand(50)
        return a, b, c

    def generate_ans(data):
        _a = data
        a, b, c = _a
        result = np.mean([a, b, c], axis=0)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a, b, c = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import pandas as pd
import numpy as np
a = pd.Series([10, 20, 30])
b = pd.Series([30, 20, 20])
c = pd.Series([50, 20, 40])

result = ... # put solution in this variable

import numpy as np
import pandas as pd
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = pd.Series([10, 20, 30])
            b = pd.Series([30, 20, 20])
            c = pd.Series([50, 20, 40])
        elif test_case_id == 2:
            np.random.seed(42)
            a = pd.Series(np.random.rand(50))
            b = pd.Series(np.random.rand(50))
            c = pd.Series(np.random.rand(50))
        return a, b, c

    def generate_ans(data):
        _a = data
        a, b, c = _a
        result = pd.concat([a, b, c], axis=1).mean(axis=1)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    pd.testing.assert_series_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
a, b, c = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)


import numpy as np
import pandas as pd
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = np.array([10, 20, 30])
            b = np.array([30, 20, 20])
            c = np.array([50, 20, 40])
        elif test_case_id == 2:
            np.random.seed(42)
            a = np.random.rand(50)
            b = np.random.rand(50)
            c = np.random.rand(50)
        return a, b, c

    def generate_ans(data):
        _a = data
        a, b, c = _a
        result = np.max([a, b, c], axis=0)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    np.testing.assert_array_equal(result, ans)
    return 1

exec_context = r"""
import numpy as np
a, b, c = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)

import numpy as np
import pandas as pd
import copy

def generate_test_case(test_case_id):
    def define_test_input(test_case_id):
        if test_case_id == 1:
            a = pd.Series([10, 20, 30])
            b = pd.Series([30, 20, 20])
            c = pd.Series([50, 20, 40])
        elif test_case_id == 2:
            np.random.seed(42)
            a = pd.Series(np.random.rand(50))
            b = pd.Series(np.random.rand(50))
            c = pd.Series(np.random.rand(50))
        return a, b, c

    def generate_ans(data):
        _a = data
        a, b, c = _a
        result = pd.concat([a, b, c], axis=1).max(axis=1)
        return result

    test_input = define_test_input(test_case_id)
    expected_result = generate_ans(copy.deepcopy(test_input))
    return test_input, expected_result

def exec_test(result, ans):
    pd.testing.assert_series_equal(result, ans)
    return 1

exec_context = r"""
import pandas as pd
a, b, c = test_input
[insert]
"""

def test_execution(solution: str):
    code = exec_context.replace("[insert]", solution)
    for i in range(2):
        test_input, expected_result = generate_test_case(i + 1)
        test_env = {"test_input": test_input}
        exec(code, test_env)
        assert exec_test(test_env["result"], expected_result)