{"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":"d7aa5531-8c54-56c4-a210-f5d02a413aa1","task_key":"default--test--271","task_revision_id":"1","upstream_id":"271","short_description":"pandas version: 1.2","config":"default","split":"test","body":"{\"library\":\"Pandas\",\"prompt\":\"Problem:\\npandas version: 1.2\\nI have a dataframe that columns as 'float64' with null values represented as pd.NAN. Is there way to round without converting to string then decimal:\\ndf = pd.DataFrame([(.21, .3212), (.01, .61237), (.66123, .03), (.21, .18),(pd.NA, .18)],\\n                  columns=['dogs', 'cats'])\\ndf\\n      dogs     cats\\n0     0.21  0.32120\\n1     0.01  0.61237\\n2  0.66123  0.03000\\n3     0.21  0.18000\\n4     <NA>  0.18000\\n\\n\\nHere is what I wanted to do, but it is erroring:\\ndf['dogs'] = df['dogs'].round(2)\\n\\n\\nTypeError: float() argument must be a string or a number, not 'NAType'\\n\\n\\nHere is another way I tried but this silently fails and no conversion occurs:\\ntn.round({'dogs': 1})\\n      dogs     cats\\n0     0.21  0.32120\\n1     0.01  0.61237\\n2  0.66123  0.03000\\n3     0.21  0.18000\\n4     <NA>  0.18000\\n\\n\\nA:\\n<code>\\nimport pandas as pd\\n\\n\\ndf = pd.DataFrame([(.21, .3212), (.01, .61237), (.66123, .03), (.21, .18),(pd.NA, .18)],\\n                  columns=['dogs', 'cats'])\\n</code>\\ndf = ... # 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":[]}