{"action":"opened","issue":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/17005","repository_url":"https://api.github.com/repos/pandas-dev/pandas","labels_url":"https://api.github.com/repos/pandas-dev/pandas/issues/17005/labels{/name}","comments_url":"https://api.github.com/repos/pandas-dev/pandas/issues/17005/comments","events_url":"https://api.github.com/repos/pandas-dev/pandas/issues/17005/events","html_url":"https://github.com/pandas-dev/pandas/issues/17005","id":243618817,"number":17005,"title":"Uninteded cast from int to float in pd.crosstab with different indexes","user":{"login":"toobaz","id":1224492,"avatar_url":"https://avatars1.githubusercontent.com/u/1224492?v=4","gravatar_id":"","url":"https://api.github.com/users/toobaz","html_url":"https://github.com/toobaz","followers_url":"https://api.github.com/users/toobaz/followers","following_url":"https://api.github.com/users/toobaz/following{/other_user}","gists_url":"https://api.github.com/users/toobaz/gists{/gist_id}","starred_url":"https://api.github.com/users/toobaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toobaz/subscriptions","organizations_url":"https://api.github.com/users/toobaz/orgs","repos_url":"https://api.github.com/users/toobaz/repos","events_url":"https://api.github.com/users/toobaz/events{/privacy}","received_events_url":"https://api.github.com/users/toobaz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-18T07:03:53Z","updated_at":"2017-07-18T07:03:53Z","closed_at":null,"body":"#### Code Sample, a copy-pastable example if possible\r\n\r\n```python\r\nIn [2]: pd.crosstab(pd.Series([1,2,3]), pd.Series([1,2]))\r\nOut[2]: \r\ncol_0  1.0  2.0\r\nrow_0          \r\n1        1    0\r\n2        0    1\r\n```\r\n#### Problem description\r\n\r\nThe shorter series gets casted to float before the computation, which one would not expect, given that index elements with at least one missing value are discarded in the computation..\r\n\r\n#### Expected Output\r\nThe same as\r\n\r\n```python\r\nIn [3]: pd.crosstab(pd.Series([1,2]), pd.Series([1,2]))\r\nOut[3]: \r\ncol_0  1  2\r\nrow_0      \r\n1      1  0\r\n2      0  1\r\n```\r\n\r\n#### Output of ``pd.show_versions()``\r\n\r\n<details>\r\nINSTALLED VERSIONS\r\n------------------\r\ncommit: ea487fc9b197285f25b066450c46fc456db09e2a\r\npython: 3.5.3.final.0\r\npython-bits: 64\r\nOS: Linux\r\nOS-release: 4.9.0-3-amd64\r\nmachine: x86_64\r\nprocessor: \r\nbyteorder: little\r\nLC_ALL: None\r\nLANG: it_IT.UTF-8\r\nLOCALE: it_IT.UTF-8\r\n\r\npandas: 0.21.0.dev+258.gea487fc9b.dirty\r\npytest: 3.0.6\r\npip: 9.0.1\r\nsetuptools: None\r\nCython: 0.25.2\r\nnumpy: 1.12.1\r\nscipy: 0.19.0\r\nxarray: None\r\nIPython: 5.1.0.dev\r\nsphinx: 1.5.6\r\npatsy: 0.4.1\r\ndateutil: 2.6.0\r\npytz: 2017.2\r\nblosc: None\r\nbottleneck: 1.2.1\r\ntables: 3.3.0\r\nnumexpr: 2.6.1\r\nfeather: 0.3.1\r\nmatplotlib: 2.0.2\r\nopenpyxl: None\r\nxlrd: 1.0.0\r\nxlwt: 1.1.2\r\nxlsxwriter: 0.9.6\r\nlxml: None\r\nbs4: 4.5.3\r\nhtml5lib: 0.999999999\r\nsqlalchemy: 1.0.15\r\npymysql: None\r\npsycopg2: None\r\njinja2: 2.9.6\r\ns3fs: None\r\npandas_gbq: None\r\npandas_datareader: 0.2.1\r\n</details>\r\n"}}
{"actor":{"display_login":"toobaz"}}