{"task": {"agent_timeout": 1800, "task": "212", "verifier_timeout": 1800, "instruction": "# 212: DS-1000 Task\n\n## Prompt\nProblem:\nI have the following dataframe:\n  key1  key2\n0    a   one\n1    a   two\n2    b   one\n3    b   two\n4    a   one\n5    c   two\n\nNow, I want to group the dataframe by the key1 and count the column key2 with the value \"one\" to get this result:\n  key1  count\n0    a      2\n1    b      1\n2    c      0\n\nI just get the usual count with:\ndf.groupby(['key1']).size()\n\nBut I don't know how to insert the condition.\nI tried things like this:\ndf.groupby(['key1']).apply(df[df['key2'] == 'one'])\n\nBut I can't get any further.  How can I do this?\n\nA:\n<code>\nimport pandas as pd\n\n\ndf = pd.DataFrame({'key1': ['a', 'a', 'b', 'b', 'a', 'c'],\n                   'key2': ['one', 'two', 'one', 'two', 'one', 'two']})\n</code>\nresult = ... # put solution in this variable\nBEGIN SOLUTION\n<code>\n\n## What to do\n- Edit `solution/solution.py` so the code passes the DS-1000 tests.\n- Do not access the internet or install new packages; required libraries are preinstalled in the Docker image.\n- Run tests locally via `bash tests/test.sh`.\n\n## Notes\n- Keep the variable names/signatures implied by the prompt/code_context.\n- The evaluator uses the original DS-1000 `code_context` (`test_execution` / `test_string`).\n", "memory": "", "runnable": false, "difficulty": "", "language": "", "cpus": "", "instruction_truncated": false, "category": "", "compose": false, "has_solution": true, "oracle": null, "docker_image": "ds1000:latest", "taskset": "ds1000", "tags": []}, "runs": []}