{"kind":"task","effective_mode":"full","benchmark":{"kind":"benchmark","effective_mode":"full","slug":"ds-1000","formal_name":"DS-1000","introduction":"DS-1000 builds 1,000 data-science problems from real StackOverflow questions across seven libraries including NumPy, Pandas and Matplotlib. The problems are perturbed so that recalling the original answer does not solve them.","introduction_ja":"","introduction_en":"","category":"Category not supplied","task_count":null,"acquisition_status":"Acquisition status not supplied","official_url":"https://ds1000-code-gen.github.io/","indexing_mode":"index","profile":{"resources":[],"task_format":"","scoring":"","metric":"","size":"","answer_access":"","license":"","citation":"","maintainer":"","released":"","why_hard":"","related":[],"history":"","construction":"","limitations":"","saturation":"","scores":[]}},"task_id":"53540930-e20e-56af-9644-9f384d95f65c","task_key":"default--test--500","task_revision_id":"1","upstream_id":"500","short_description":"In order to get a numpy array from a list I make the following:","config":"default","split":"test","body":"{\"library\":\"Numpy\",\"prompt\":\"Problem:\\nIn order to get a numpy array from a list I make the following:\\nSuppose n = 12\\nnp.array([i for i in range(0, n)])\\nAnd get:\\narray([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11])\\nThen I would like to make a (4,3) matrix from this array:\\nnp.array([i for i in range(0, 12)]).reshape(4, 3)\\nand I get the following matrix:\\narray([[ 0,  1,  2],\\n       [ 3,  4,  5],\\n       [ 6,  7,  8],\\n       [ 9, 10, 11]])\\nBut if I know that I will have 3 * n elements in the initial list how can I reshape my numpy array, because the following code\\nnp.array([i for i in range(0,12)]).reshape(a.shape[0]/3,3)\\nResults in the error\\nTypeError: 'float' object cannot be interpreted as an integer\\nA:\\n<code>\\nimport numpy as np\\na = np.arange(12)\\n</code>\\na = ... # put solution in this variable\\nBEGIN SOLUTION\\n<code>\\n\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://ds1000-code-gen.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}