{"task": {"agent_timeout": 1800, "task": "198", "verifier_timeout": 1800, "instruction": "# 198: DS-1000 Task\n\n## Prompt\nProblem:\nI am trying to get count of letter chars in column using Pandas.\nBut not getting desired output.\nMy .txt file is:\nstr\nAa\nBb\n?? ?\nx;\n###\n\n\nMy Code is :\nimport pandas as pd\ndf=pd.read_csv('inn.txt',sep='\\t')\ndef count_special_char(string):\n    special_char = 0\n    for i in range(len(string)):\n        if(string[i].isalpha()):\n            continue\n        else:\n            special_char = special_char + 1\ndf[\"new\"]=df.apply(count_special_char, axis = 0)\nprint(df)\n\n\nAnd the output is:\n    str  new\n0    Aa  NaN\n1    Bb  NaN\n2  ?? ?  NaN\n3   ###  NaN\n4   x;      Nan\n\n\nDesired output is:\n      str  new\n0      Aa    2\n1      Bb    2\n2    ?? ?    0\n3     ###    0\n4  {}xxa;    3\n\n\n\n\nHow to go ahead on this ?\n\n\nA:\n<code>\nimport pandas as pd\n\n\ndf = pd.DataFrame({'str': ['Aa', 'Bb', '?? ?', '###', '{}xxa;']})\n</code>\ndf = ... # 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": []}