Ad
  • Custom User Avatar

    Callers error:

    Traceback (most recent call last):
      File "/workspace/default/.venv/lib/python3.10/site-packages/codewars_test/test_framework.py", line 112, in wrapper
        func()
      File "/workspace/default/tests.py", line 19, in basic_test_cases
        test.assert_equals(string_chunk('the girl is missing'), []);
    TypeError: string_chunk() missing 1 required positional argument: 'n'
    
  • Custom User Avatar

    good tip, will try

  • Custom User Avatar

    I love it, but seem to fail the random tests. How could this be?
    Time: 553ms Passed: 77 Failed: 27 Exit Code: 1

  • Custom User Avatar

    Hey, thank you for your reply,

    I will keep on trying, best I got so far is

    invalid literal for int() with base 10: 'a'
    
  • Custom User Avatar

    Time: 2553ms Passed: 57 Failed: 44 Exit Code: 1

    # list of columns gotten with to_list()
    tst_5 = [[3, 3, [0, 5, 6, 9, 10, 10, 6]]]
    
    # my call to flatten to simulate the failed test
    print(flatten(pd.DataFrame(data=tst_5[0], columns=list("A"))))
    
    # returnable inside the function
    {'A': [3, 3, 0, 5, 6, 9, 10, 10, 6]}
    # tested with DataFrame() and DataFrame().to_dict() same fails
    

    fails and outputs:

    Wrong output: Expected:
        A
    0   3
    1   3
    2   0
    3   5
    4   6
    5   9
    6  10
    7  10
    8   6
    
    Actual:
        A
    0   3
    1   3
    2   0
    3   5
    4   6
    5   9
    6  10
    7  10
    8   6
    

    It fails even with a single column. Any help please?
    Here is the dtypes output

    A    int64
    dtype: object
    
  • Custom User Avatar

    Nice one, can't wait for the python translation.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution