{"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":"ea925937-de92-55e9-a1b0-81d8b22faf0c","task_key":"default--test--785","task_revision_id":"1","upstream_id":"785","short_description":"I would like to resample a numpy array as suggested here Resampling a numpy…","config":"default","split":"test","body":"{\"library\":\"Scipy\",\"prompt\":\"Problem:\\nI would like to resample a numpy array as suggested here Resampling a numpy array representing an image however this resampling will do so by a factor i.e.\\nx = np.arange(9).reshape(3,3)\\nprint scipy.ndimage.zoom(x, 2, order=1)\\nWill create a shape of (6,6) but how can I resample an array to its best approximation within a (4,6),(6,8) or (6,10) shape for instance?\\nA:\\n<code>\\nimport numpy as np\\nimport scipy.ndimage\\nx = np.arange(9).reshape(3, 3)\\nshape = (6, 8)\\n</code>\\nresult = ... # 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":[]}