{"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":"30af8612-0229-52e1-96b8-f50951037439","task_key":"default--test--55","task_revision_id":"2","upstream_id":"55","short_description":"The title might not be intuitive--let me provide an example. Say I have df,…","config":"default","split":"test","body":"{\"prompt\":\"Problem:\\nThe title might not be intuitive--let me provide an example.  Say I have df, created with:\\na = np.array([[ 1. ,  0.9,  1. ],\\n              [ 0.9,  0.9,  1. ],\\n              [ 0.8,  1. ,  0.5],\\n              [ 1. ,  0.3,  0.2],\\n              [ 1. ,  0.2,  0.1],\\n              [ 0.9,  1. ,  1. ],\\n              [ 1. ,  0.9,  1. ],\\n              [ 0.6,  0.9,  0.7],\\n              [ 1. ,  0.9,  0.8],\\n              [ 1. ,  0.8,  0.9]])\\nidx = pd.date_range('2017', periods=a.shape[0])\\ndf = pd.DataFrame(a, index=idx, columns=list('abc'))\\n\\n\\nI can get the index location of each respective column minimum with\\ndf.idxmin()\\n\\n\\nNow, how could I get the location of the first occurrence of the column-wise maximum, down to the location of the minimum?\\n\\n\\nwhere the max's before the minimum occurrence are ignored.\\nI can do this with .apply, but can it be done with a mask/advanced indexing\\nDesired result:\\na   2017-01-09\\nb   2017-01-06\\nc   2017-01-06\\ndtype: datetime64[ns]\\n\\n\\nA:\\n<code>\\nimport pandas as pd\\nimport numpy as np\\n\\n\\na = np.array([[ 1. ,  0.9,  1. ],\\n              [ 0.9,  0.9,  1. ],\\n              [ 0.8,  1. ,  0.5],\\n              [ 1. ,  0.3,  0.2],\\n              [ 1. ,  0.2,  0.1],\\n              [ 0.9,  1. ,  1. ],\\n              [ 1. ,  0.9,  1. ],\\n              [ 0.6,  0.9,  0.7],\\n              [ 1. ,  0.9,  0.8],\\n              [ 1. ,  0.8,  0.9]])\\n\\n\\nidx = pd.date_range('2017', periods=a.shape[0])\\ndf = pd.DataFrame(a, index=idx, columns=list('abc'))\\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":[]}