{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/12666","repository_url":"https://api.github.com/repos/pydata/pandas","labels_url":"https://api.github.com/repos/pydata/pandas/issues/12666/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/12666/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/12666/events","html_url":"https://github.com/pydata/pandas/issues/12666","id":141936372,"number":12666,"title":"BUG: Segfault in DataFrame.pivot with complex","user":{"login":"ycopin","id":812050,"avatar_url":"https://avatars.githubusercontent.com/u/812050?v=3","gravatar_id":"","url":"https://api.github.com/users/ycopin","html_url":"https://github.com/ycopin","followers_url":"https://api.github.com/users/ycopin/followers","following_url":"https://api.github.com/users/ycopin/following{/other_user}","gists_url":"https://api.github.com/users/ycopin/gists{/gist_id}","starred_url":"https://api.github.com/users/ycopin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ycopin/subscriptions","organizations_url":"https://api.github.com/users/ycopin/orgs","repos_url":"https://api.github.com/users/ycopin/repos","events_url":"https://api.github.com/users/ycopin/events{/privacy}","received_events_url":"https://api.github.com/users/ycopin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/Bug","name":"Bug","color":"e10c02"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Complex","name":"Complex","color":"009800"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Difficulty%20Intermediate","name":"Difficulty Intermediate","color":"fbca04"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Effort%20Low","name":"Effort Low","color":"006b75"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Reshaping","name":"Reshaping","color":"02d7e1"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/pydata/pandas/milestones/38","html_url":"https://github.com/pydata/pandas/milestones/0.18.1","labels_url":"https://api.github.com/repos/pydata/pandas/milestones/38/labels","id":1570594,"number":38,"title":"0.18.1","description":"after 0.18.0 of course!","creator":{"login":"jreback","id":953992,"avatar_url":"https://avatars.githubusercontent.com/u/953992?v=3","gravatar_id":"","url":"https://api.github.com/users/jreback","html_url":"https://github.com/jreback","followers_url":"https://api.github.com/users/jreback/followers","following_url":"https://api.github.com/users/jreback/following{/other_user}","gists_url":"https://api.github.com/users/jreback/gists{/gist_id}","starred_url":"https://api.github.com/users/jreback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreback/subscriptions","organizations_url":"https://api.github.com/users/jreback/orgs","repos_url":"https://api.github.com/users/jreback/repos","events_url":"https://api.github.com/users/jreback/events{/privacy}","received_events_url":"https://api.github.com/users/jreback/received_events","type":"User","site_admin":false},"open_issues":162,"closed_issues":40,"state":"open","created_at":"2016-02-08T15:29:59Z","updated_at":"2016-03-20T20:46:05Z","due_on":"2016-04-26T04:00:00Z","closed_at":null},"comments":12,"created_at":"2016-03-18T17:56:48Z","updated_at":"2016-03-20T21:57:25Z","closed_at":null,"body":"With attached CSV-file [test_csv.txt](https://github.com/pydata/pandas/files/180140/test_csv.txt), the following code will segfault if the input dataframe has more than 17 entries:\r\n\r\n```python\r\nimport pandas as PD\r\n\r\ndf = PD.read_csv('test_csv.txt',\r\n                 index_col=0,\r\n                 converters={'xyinrad': complex,\r\n                             'xyoutm': complex})\r\n\r\n# Pivot works fine with 17 entries\r\ndf[:-1].info()\r\npivot = df[:-1].pivot('wave', 'xyinrad', 'xyoutm')\r\nprint(\"Still alive\".center(50, '!'))\r\n\r\n# Pivot segfaults with 18 entries\r\ndf.info()\r\nprint(\"Dave, my mind is going.\".center(50, '.'))\r\npivot = df.pivot('wave', 'xyinrad', 'xyoutm')\r\n```\r\n\r\n#### Result\r\n\r\n```\r\n<class 'pandas.core.frame.DataFrame'>\r\nInt64Index: 16 entries, 0 to 15\r\nData columns (total 3 columns):\r\nwave       16 non-null float64\r\nxyinrad    16 non-null complex128\r\nxyoutm     16 non-null complex128\r\ndtypes: complex128(2), float64(1)\r\nmemory usage: 768.0 bytes\r\n!!!!!!!!!!!!!!!!!!!Still alive!!!!!!!!!!!!!!!!!!!!\r\n<class 'pandas.core.frame.DataFrame'>\r\nInt64Index: 17 entries, 0 to 16\r\nData columns (total 3 columns):\r\nwave       17 non-null float64\r\nxyinrad    17 non-null complex128\r\nxyoutm     17 non-null complex128\r\ndtypes: complex128(2), float64(1)\r\nmemory usage: 816.0 bytes\r\n.............Dave, my mind is going...............\r\nSegmentation fault (core dumped)\r\n```\r\n\r\n#### Expected Output\r\n\r\n* No segfault!\r\n* Return the pivot table\r\n\r\n#### Output of `pd.show_versions()`\r\n\r\n```\r\nINSTALLED VERSIONS\r\n------------------\r\ncommit: None\r\npython: 2.7.6.final.0\r\npython-bits: 32\r\nOS: Linux\r\nOS-release: 3.16.0-38-generic\r\nmachine: i686\r\nprocessor: i686\r\nbyteorder: little\r\nLC_ALL: None\r\nLANG: en_US.UTF-8\r\n\r\npandas: 0.18.0\r\nnose: 1.3.4\r\npip: 8.1.1\r\nsetuptools: 20.3\r\nCython: 0.21.1\r\nnumpy: 1.10.4\r\nscipy: 0.16.1\r\nstatsmodels: None\r\nxarray: None\r\nIPython: 4.1.2\r\nsphinx: 1.3.5\r\npatsy: None\r\ndateutil: 2.5.0\r\npytz: 2016.1\r\nblosc: None\r\nbottleneck: None\r\ntables: None\r\nnumexpr: None\r\nmatplotlib: 1.5.1\r\nopenpyxl: None\r\nxlrd: None\r\nxlwt: None\r\nxlsxwriter: None\r\nlxml: None\r\nbs4: None\r\nhtml5lib: None\r\nhttplib2: 0.8\r\napiclient: None\r\nsqlalchemy: None\r\npymysql: None\r\npsycopg2: 2.4.5 (dt dec mx pq3 ext)\r\njinja2: 2.8\r\nboto: None\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/199040706","html_url":"https://github.com/pydata/pandas/issues/12666#issuecomment-199040706","issue_url":"https://api.github.com/repos/pydata/pandas/issues/12666","id":199040706,"user":{"login":"jreback","id":953992,"avatar_url":"https://avatars.githubusercontent.com/u/953992?v=3","gravatar_id":"","url":"https://api.github.com/users/jreback","html_url":"https://github.com/jreback","followers_url":"https://api.github.com/users/jreback/followers","following_url":"https://api.github.com/users/jreback/following{/other_user}","gists_url":"https://api.github.com/users/jreback/gists{/gist_id}","starred_url":"https://api.github.com/users/jreback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreback/subscriptions","organizations_url":"https://api.github.com/users/jreback/orgs","repos_url":"https://api.github.com/users/jreback/repos","events_url":"https://api.github.com/users/jreback/events{/privacy}","received_events_url":"https://api.github.com/users/jreback/received_events","type":"User","site_admin":false},"created_at":"2016-03-20T21:57:24Z","updated_at":"2016-03-20T21:57:24Z","body":"I think the test_algos is most appropriate "}}