{"action":"opened","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/13511","repository_url":"https://api.github.com/repos/pydata/pandas","labels_url":"https://api.github.com/repos/pydata/pandas/issues/13511/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/13511/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/13511/events","html_url":"https://github.com/pydata/pandas/issues/13511","id":162273646,"number":13511,"title":"NaN label in MultiIndex is assigned a non NaN value when writing to excel file","user":{"login":"mpuels","id":2924816,"avatar_url":"https://avatars.githubusercontent.com/u/2924816?v=3","gravatar_id":"","url":"https://api.github.com/users/mpuels","html_url":"https://github.com/mpuels","followers_url":"https://api.github.com/users/mpuels/followers","following_url":"https://api.github.com/users/mpuels/following{/other_user}","gists_url":"https://api.github.com/users/mpuels/gists{/gist_id}","starred_url":"https://api.github.com/users/mpuels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpuels/subscriptions","organizations_url":"https://api.github.com/users/mpuels/orgs","repos_url":"https://api.github.com/users/mpuels/repos","events_url":"https://api.github.com/users/mpuels/events{/privacy}","received_events_url":"https://api.github.com/users/mpuels/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-06-25T09:54:49Z","updated_at":"2016-06-25T09:54:49Z","closed_at":null,"body":"Given a DataFrame which has a MultiIndex. When a label of the MultiIndex has the value NaN and the DataFrame is written to an excel file, the label will have a value which is not NaN in the excel file.\r\n\r\n#### Code Sample, a copy-pastable example if possible\r\n    df = pd.DataFrame({'c1': [1,1,2,2],\r\n                       'c2': [None] + \"b a b\".split()})\r\n    df\r\n\r\nreturns a DataFrame where the first element of column 'c2' is NaN:\r\n\r\n    \tc1\tc2\r\n    0\t1\t\r\n    1\t1\tb\r\n    2\t2\ta\r\n    3\t2\tb\r\n\r\nSet both columns as the index:\r\n\r\n    df_midx = df.set_index(['c1', 'c2'])\r\n    df_midx\r\n\r\nreturns\r\n\r\n    c1\tc2\r\n    1\t\r\n    1\tb\r\n    2\ta\r\n    2\tb\r\n\r\nWrite DataFrame to excel file and read it back in:\r\n\r\n    df_midx.to_excel('df_midx.xlsx')\r\n    df_midx_from_xlsx = pd.read_excel('df_midx.xlsx')\r\n    df_midx_from_xlsx\r\n\r\nreturns\r\n\r\n    \tc1\tc2\r\n    0\t1.0\tb\r\n    1\t\tb\r\n    2\t2.0\ta\r\n    3\t\tb\r\n\r\nThe first element of column 'c2' is now set to 'b' instead of NaN.\r\n\r\n#### Expected Output\r\n    \tc1\tc2\r\n    0\t1.0\r\n    1\t\tb\r\n    2\t2.0\ta\r\n    3\t\tb\r\n\r\n#### output of ``pd.show_versions()``\r\nINSTALLED VERSIONS\r\n------------------\r\ncommit: ac174349b0e1525475c2354e1c0b8ee1ed1cabad\r\npython: 2.7.6.final.0\r\npython-bits: 64\r\nOS: Linux\r\nOS-release: 3.13.0-88-generic\r\nmachine: x86_64\r\nprocessor: x86_64\r\nbyteorder: little\r\nLC_ALL: None\r\nLANG: en_US.UTF-8\r\n\r\npandas: 0.18.1\r\nnose: None\r\npip: 1.5.4\r\nsetuptools: 2.2\r\nCython: None\r\nnumpy: 1.11.0\r\nscipy: 0.16.1\r\nstatsmodels: 0.6.1\r\nxarray: None\r\nIPython: 4.0.1\r\nsphinx: None\r\npatsy: 0.4.1\r\ndateutil: 2.5.3\r\npytz: 2016.4\r\nblosc: None\r\nbottleneck: None\r\ntables: None\r\nnumexpr: 2.5.2\r\nmatplotlib: 1.5.0\r\nopenpyxl: 2.3.5\r\nxlrd: 1.0.0\r\nxlwt: None\r\nxlsxwriter: None\r\nlxml: None\r\nbs4: None\r\nhtml5lib: None\r\nhttplib2: None\r\napiclient: None\r\nsqlalchemy: None\r\npymysql: None\r\npsycopg2: None\r\njinja2: 2.8\r\nboto: None\r\npandas_datareader: None\r\n"}}
{"actor":{"display_login":"mpuels"}}