{"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":"09ee34aa-8f4b-5937-8614-5084785c679d","task_key":"default--test--272","task_revision_id":"1","upstream_id":"272","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, pd.NA), (.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     <NA>\\n3     0.21  0.18000\\n4     <NA>  0.188\\n\\n\\nFor rows without pd.NAN, here is what I wanted to do, but it is erroring:\\ndf['dogs'] = df['dogs'].round(2)\\ndf['cats'] = df['cats'].round(2)\\n\\n\\nTypeError: float() argument must be a string or a number, not 'NAType'\\n\\n\\nHere is my desired output:\\n      dogs   cats\\n0     0.21   0.32\\n1     0.01   0.61\\n2  0.66123   <NA>\\n3     0.21   0.18\\n4     <NA>  0.188\\n\\n\\n\\n\\nA:\\n<code>\\nimport pandas as pd\\n\\n\\ndf = pd.DataFrame([(.21, .3212), (.01, .61237), (.66123, pd.NA), (.21, .18),(pd.NA, .188)],\\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":[]}