{"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":"e7fa5309-65a1-574b-b92b-067518653649","task_key":"default--test--938","task_revision_id":"1","upstream_id":"938","short_description":"I'd like to convert a torch tensor to pandas dataframe but by using pd.DataFrame…","config":"default","split":"test","body":"{\"library\":\"Pytorch\",\"prompt\":\"Problem:\\n\\nI'd like to convert a torch tensor to pandas dataframe but by using pd.DataFrame I'm getting a dataframe filled with tensors instead of numeric values.\\n\\nimport torch\\nimport pandas as  pd\\nx = torch.rand(4,4)\\npx = pd.DataFrame(x)\\nHere's what I get when clicking on px in the variable explorer:\\n\\n0   1   2   3\\ntensor(0.3880)  tensor(0.4598)  tensor(0.4239)  tensor(0.7376)\\ntensor(0.4174)  tensor(0.9581)  tensor(0.0987)  tensor(0.6359)\\ntensor(0.6199)  tensor(0.8235)  tensor(0.9947)  tensor(0.9679)\\ntensor(0.7164)  tensor(0.9270)  tensor(0.7853)  tensor(0.6921)\\n\\n\\nA:\\n\\n<code>\\nimport numpy as np\\nimport torch\\nimport pandas as pd\\nx = load_data()\\n</code>\\npx = ... # 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":[]}