{"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":"noindex","profile":{"resources":[],"task_format":"","scoring":"","metric":"","size":"","answer_access":"","license":"","citation":"","maintainer":"","released":"","why_hard":"","related":[]}},"task_id":"e51e3eae-2ed8-56ac-ae54-90bc9ed50f99","task_key":"default--test--51","task_revision_id":"2","upstream_id":"51","short_description":"Sample dataframe:","config":"default","split":"test","body":"{\"prompt\":\"Problem:\\nSample dataframe:\\ndf = pd.DataFrame({\\\"A\\\": [1, 2, 3], \\\"B\\\": [4, 5, 6]})\\n\\nI'd like to add exponentials of each existing column to the dataframe and name them based on existing column names with a prefix, e.g. exp_A is an exponential of column A and so on.\\nThe resulting dataframe should look like so:\\nresult = pd.DataFrame({\\\"A\\\": [1, 2, 3], \\\"B\\\": [4, 5, 6], \\\"exp_A \\\": [e^1, e^2, e^3], \\\"exp_B \\\": [e^4, e^5, e^6]})\\n\\nNotice that e is the natural constant.\\nObviously there are redundant methods like doing this in a loop, but there should exist much more pythonic ways of doing it and after searching for some time I didn't find anything. I understand that this is most probably a duplicate; if so, please point me to an existing answer.\\n\\nA:\\n<code>\\nimport pandas as pd\\n\\n\\ndf = pd.DataFrame({\\\"A\\\": [1, 2, 3], \\\"B\\\": [4, 5, 6]})\\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":"noindex","subproblems":[],"grids":[]}