{"action":"closed","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/14250","repository_url":"https://api.github.com/repos/pydata/pandas","labels_url":"https://api.github.com/repos/pydata/pandas/issues/14250/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/14250/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/14250/events","html_url":"https://github.com/pydata/pandas/issues/14250","id":177819967,"number":14250,"title":"rename() take datetime.date as a function","user":{"login":"fluency03","id":7440735,"avatar_url":"https://avatars.githubusercontent.com/u/7440735?v=3","gravatar_id":"","url":"https://api.github.com/users/fluency03","html_url":"https://github.com/fluency03","followers_url":"https://api.github.com/users/fluency03/followers","following_url":"https://api.github.com/users/fluency03/following{/other_user}","gists_url":"https://api.github.com/users/fluency03/gists{/gist_id}","starred_url":"https://api.github.com/users/fluency03/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fluency03/subscriptions","organizations_url":"https://api.github.com/users/fluency03/orgs","repos_url":"https://api.github.com/users/fluency03/repos","events_url":"https://api.github.com/users/fluency03/events{/privacy}","received_events_url":"https://api.github.com/users/fluency03/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/Usage%20Question","name":"Usage Question","color":"0052cc"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-19T15:40:46Z","updated_at":"2016-09-20T09:45:51Z","closed_at":"2016-09-20T09:45:51Z","body":"I would like to rename a pd.Series but got two results on two different platforms.\r\n\r\nFor example, if I have a pd.Series as `a` and a datetime.date as `one_date`, and I do:\r\n\r\n    a.rename(one_date)\r\n\r\nOn my own laptop (Window 7, Python 2.7), I got no error.\r\n\r\nBut when I do this on a server (Linux, Python 2.7), I got an error: \r\n\r\nTraceback (most recent call last):\r\n  File \"as.py\", line 626, in <module>\r\n    run_batch(sys.argv[1:])\r\n  File \"as.py\", line 549, in run_batch\r\n    analyzer.analyze_batch(one_user, batch_index_user, user_index)\r\n  File \"as.py\", line 467, in analyze_batch\r\n    clicks_one_date)\r\n  File \"as.py\", line 434, in analyze_one_date_batch\r\n    return counts_on_date.rename(one_date)\r\n  File \"/home/xxx/anaconda2/anaconda/lib/python2.7/site-packages/pandas/core/series.py\", line 2264, in rename\r\n    return super(Series, self).rename(index=index, **kwargs)\r\n  File \"/home/xxx/anaconda2/anaconda/lib/python2.7/site-packages/pandas/core/generic.py\", line 606, in rename\r\n    result._data = result._data.rename_axis(f, axis=baxis, copy=copy)\r\n  File \"/home/xxx/anaconda2/anaconda/lib/python2.7/site-packages/pandas/core/internals.py\", line 2588, in rename_axis\r\n    obj.set_axis(axis, _transform_index(self.axes[axis], mapper))\r\n  File \"/home/xxx/anaconda2/anaconda/lib/python2.7/site-packages/pandas/core/internals.py\", line 4391, in _transform_index\r\n    items = [func(x) for x in index]\r\nTypeError: 'datetime.date' object is not callable\r\n\r\n---\r\n\r\nIt seems like the method `rename` take the `one_date` as a function instead of a scalar value. Then it tried to call the `datetime.date` as a function but it is not callable.\r\n\r\nAnyone has some idea about how to deal with it?\r\n\r\nThanks. \r\n\r\n"}}
{"actor":{"display_login":"fluency03"}}