Mbpp
Hugging FaceDataset Card for Mostly Basic Python Problems (mbpp) Dataset Summary The benchmark consists of around 1,000 crowd-sourced Python programming problems, designed to be solvable by entry level programmers, covering programming fundamentals, standard library functionality, and so on. Each problem consists of a task description, code solution and 3 automated test cases. As described in the paper, a subset of the data has been hand-verified by us. Released here as part of… See the full description on the dataset page: https://huggingface.co/datasets/google-research-datasets/mbpp.
Ask a question about this data
Type any question in plain English — Helix builds the chart with AI. Sign in to run it and save your charts.
Data preview
374 rows · 6 columns · showing first 12| # | task_id integer | text text | code text | test_list text | test_setup_code text | challenge_test_list text |
|---|---|---|---|---|---|---|
| 1 | 601 | Write a function to find the longest chain which can be formed from the given set of pairs. | class Pair(object): def __init__(self, a, b): self.a = a self.b = b def max_chain_length(arr, n): max = 0 mcl = [1 for i … | ['assert max_chain_length([Pair(5, 24), Pair(15, 25),Pair(27, 40), Pair(50, 60)], 4) == 3' 'assert max_chain_length([Pair(1, 2), Pair(3, 4… | [] | |
| 2 | 602 | Write a python function to find the first repeated character in a given string. | def first_repeated_char(str1): for index,c in enumerate(str1): if str1[:index+1].count(c) > 1: return c return "None" | ['assert first_repeated_char("abcabc") == "a"' 'assert first_repeated_char("abc") == "None"' 'assert first_repeated_char("123123") == "1"… | [] | |
| 3 | 603 | Write a function to get a lucid number smaller than or equal to n. | def get_ludic(n): ludics = [] for i in range(1, n + 1): ludics.append(i) index = 1 while(index != len(ludics)): first_ludic =… | ['assert get_ludic(10) == [1, 2, 3, 5, 7]' 'assert get_ludic(25) == [1, 2, 3, 5, 7, 11, 13, 17, 23, 25]' 'assert get_ludic(45) == [1, 2, … | [] | |
| 4 | 604 | Write a function to reverse words in a given string. | def reverse_words(s): return ' '.join(reversed(s.split())) | ['assert reverse_words("python program")==("program python")' 'assert reverse_words("java language")==("language java")' 'assert reverse_… | [] | |
| 5 | 605 | Write a function to check if the given integer is a prime number. | def prime_num(num): if num >=1: for i in range(2, num//2): if (num % i) == 0: return False else: … | ['assert prime_num(13)==True' 'assert prime_num(7)==True' 'assert prime_num(-1010)==False'] | [] | |
| 6 | 606 | Write a function to convert degrees to radians. | import math def radian_degree(degree): radian = degree*(math.pi/180) return radian | ['assert radian_degree(90)==1.5707963267948966' 'assert radian_degree(60)==1.0471975511965976' 'assert radian_degree(120)==2.094395102393… | [] | |
| 7 | 607 | Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs by … | import re pattern = 'fox' text = 'The quick brown fox jumps over the lazy dog.' def find_literals(text, pattern): match = re.search(p… | ["assert find_literals('The quick brown fox jumps over the lazy dog.', 'fox') == ('fox', 16, 19)" "assert find_literals('Its been a very c… | [] | |
| 8 | 608 | Write a python function to find nth bell number. | def bell_Number(n): bell = [[0 for i in range(n+1)] for j in range(n+1)] bell[0][0] = 1 for i in range(1, n+1): b… | ['assert bell_Number(2) == 2' 'assert bell_Number(3) == 5' 'assert bell_Number(4) == 15'] | [] | |
| 9 | 609 | Write a python function to find minimum possible value for the given periodic function. | def floor_Min(A,B,N): x = max(B - 1,N) return (A*x) // B | ['assert floor_Min(10,20,30) == 15' 'assert floor_Min(1,2,1) == 0' 'assert floor_Min(11,10,9) == 9'] | [] | |
| 10 | 610 | Write a python function to remove the k'th element from a given list. | def remove_kth_element(list1, L): return list1[:L-1] + list1[L:] | ['assert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1]' 'assert remove_kth_element([0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8… | [] | |
| 11 | 611 | Write a function to find the maximum of nth column from the given tuple list. | def max_of_nth(test_list, N): res = max([sub[N] for sub in test_list]) return (res) | ['assert max_of_nth([(5, 6, 7), (1, 3, 5), (8, 9, 19)], 2) == 19' 'assert max_of_nth([(6, 7, 8), (2, 4, 6), (9, 10, 20)], 1) == 10' 'asse… | [] | |
| 12 | 612 | Write a python function to merge the first and last elements separately in a list of lists. | def merge(lst): return [list(ele) for ele in list(zip(*lst))] | ["assert merge([['x', 'y'], ['a', 'b'], ['m', 'n']]) == [['x', 'a', 'm'], ['y', 'b', 'n']]" 'assert merge([[1, 2], [3, 4], [5, 6], [7, 8]]… | [] |
Auto-generated charts
Mbpp: 374 rows by 6 columns. These exploratory charts are generated automatically from the data - open the dataset in Helix to ask your own questions.
Charts
Total task_id by test_setup_code
Top test_setup_code values ranked by summed task_id.
Distribution of task_id
Histogram of task_id values.
task_id by test_setup_code
Spread of task_id across test_setup_code groups.
Interesting queries to try
Columns
- task_id numeric
- text text
- code text
- test_list mixed
- test_setup_code categorical
- challenge_test_list mixed