{"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":"8e21f45b-fcc9-511b-95e0-0e30e1b5fbe5","task_key":"default--test--939","task_revision_id":"1","upstream_id":"939","short_description":"I'm trying to convert a torch tensor to pandas DataFrame.","config":"default","split":"test","body":"{\"library\":\"Pytorch\",\"prompt\":\"Problem:\\n\\nI'm trying to convert a torch tensor to pandas DataFrame.\\nHowever, the numbers in the data is still tensors, what I actually want is numerical values.\\nThis is my code\\nimport torch\\nimport pandas as  pd\\nx = torch.rand(4,4)\\npx = pd.DataFrame(x)\\nAnd px looks like\\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)\\nHow can I just get rid of 'tensor'?\\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":[]}