{"action":"closed","issue":{"url":"https://api.github.com/repos/pvlib/pvlib-python/issues/63","labels_url":"https://api.github.com/repos/pvlib/pvlib-python/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/pvlib/pvlib-python/issues/63/comments","events_url":"https://api.github.com/repos/pvlib/pvlib-python/issues/63/events","html_url":"https://github.com/pvlib/pvlib-python/issues/63","id":73971940,"number":63,"title":"ValueError: Cannot cast DatetimeIndex to dtype int32","user":{"login":"SheffieldSolar","id":12187350,"avatar_url":"https://avatars.githubusercontent.com/u/12187350?v=3","gravatar_id":"","url":"https://api.github.com/users/SheffieldSolar","html_url":"https://github.com/SheffieldSolar","followers_url":"https://api.github.com/users/SheffieldSolar/followers","following_url":"https://api.github.com/users/SheffieldSolar/following{/other_user}","gists_url":"https://api.github.com/users/SheffieldSolar/gists{/gist_id}","starred_url":"https://api.github.com/users/SheffieldSolar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SheffieldSolar/subscriptions","organizations_url":"https://api.github.com/users/SheffieldSolar/orgs","repos_url":"https://api.github.com/users/SheffieldSolar/repos","events_url":"https://api.github.com/users/SheffieldSolar/events{/privacy}","received_events_url":"https://api.github.com/users/SheffieldSolar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-07T12:37:13Z","updated_at":"2015-05-08T10:32:07Z","closed_at":"2015-05-08T10:32:07Z","body":"In windows, receive an error using index.astype in solarposition.py line 284:\r\n> \\>\\>\\> from datetime import datetime\r\n\\>\\>\\> t = datetime(2014,1,1,12,0,0)\r\n\\>\\>\\> import pandas as pd\r\n\\>\\>\\> panda_t = pd.to_datetime([t,])\r\n\\>\\>\\> import pvlib\r\n\\>\\>\\> loc = pvlib.location.Location(53, -1.5, tz='UTC')\r\n\\>\\>\\> print pvlib.solarposition.get_solarposition(panda_t, loc)\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"C:\\Users\\ph1jt\\Anaconda\\lib\\site-packages\\pvlib\\solarposition.py\", line 79, in get_solarposition\r\n    how='numpy', \\*\\*kwargs)\r\n  File \"C:\\Users\\ph1jt\\Anaconda\\lib\\site-packages\\pvlib\\solarposition.py\", line 284, in spa_python\r\n    unixtime = localize_to_utc(time, location).astype(int)/10\\*\\*9\r\n  File \"C:\\Users\\ph1jt\\Anaconda\\lib\\site-packages\\pandas\\tseries\\index.py\", line 713, in astype\r\n    raise ValueError('Cannot cast DatetimeIndex to dtype %s' % dtype)\r\nValueError: Cannot cast DatetimeIndex to dtype int32\r\n\r\nChanging line 284 in solarposition from:\r\n```python\r\n    unixtime = localize_to_utc(time, location).astype(int)/10**9\r\n```\r\nto:\r\n```python\r\n    unixtime = localize_to_utc(time, location).astype('int64')/10**9\r\n```\r\nfixes the issue."}}