{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/11007","labels_url":"https://api.github.com/repos/pydata/pandas/issues/11007/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/11007/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/11007/events","html_url":"https://github.com/pydata/pandas/issues/11007","id":105043411,"number":11007,"title":"BUG: to_excel swaps order of values of duplicate columns","user":{"login":"jorisvandenbossche","id":1020496,"avatar_url":"https://avatars.githubusercontent.com/u/1020496?v=3","gravatar_id":"","url":"https://api.github.com/users/jorisvandenbossche","html_url":"https://github.com/jorisvandenbossche","followers_url":"https://api.github.com/users/jorisvandenbossche/followers","following_url":"https://api.github.com/users/jorisvandenbossche/following{/other_user}","gists_url":"https://api.github.com/users/jorisvandenbossche/gists{/gist_id}","starred_url":"https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorisvandenbossche/subscriptions","organizations_url":"https://api.github.com/users/jorisvandenbossche/orgs","repos_url":"https://api.github.com/users/jorisvandenbossche/repos","events_url":"https://api.github.com/users/jorisvandenbossche/events{/privacy}","received_events_url":"https://api.github.com/users/jorisvandenbossche/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/IO%20Excel","name":"IO Excel","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/pydata/pandas/milestones/32","html_url":"https://github.com/pydata/pandas/milestones/Next%20Major%20Release","labels_url":"https://api.github.com/repos/pydata/pandas/milestones/32/labels","id":933188,"number":32,"title":"Next Major Release","description":"after 0.16.1 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":918,"closed_issues":72,"state":"open","created_at":"2015-01-13T10:53:19Z","updated_at":"2015-09-17T01:40:01Z","due_on":"2016-01-31T05:00:00Z","closed_at":null},"comments":11,"created_at":"2015-09-05T18:56:36Z","updated_at":"2015-09-17T09:29:06Z","closed_at":null,"body":"On master, as a small example:\r\n\r\n```\r\nIn [1]: df = pd.DataFrame([[1,2,3,4],[5,6,7,8]], columns=['A','B','A','B'])\r\n\r\nIn [2]: df\r\nOut[2]:\r\n   A  B  A  B\r\n0  1  2  3  4\r\n1  5  6  7  8\r\n\r\nIn [4]: df.to_excel('test_excel_duplicate_columns.xlsx')\r\n```\r\n\r\ngives:\r\n\r\n![capture](https://cloud.githubusercontent.com/assets/1020496/9700751/4cacf18e-540f-11e5-923b-e6d6689d569f.PNG)\r\n\r\nSo the values of columns 2 and 3 are swapped (not the column names)\r\n\r\nBTW, this happens both with .xlsx as .xls (openpyxl / xlsxwriter / xlwt)\r\n\r\nPossibly related: #10982, #10970"},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/141022001","html_url":"https://github.com/pydata/pandas/issues/11007#issuecomment-141022001","issue_url":"https://api.github.com/repos/pydata/pandas/issues/11007","id":141022001,"user":{"login":"jmcnamara","id":94267,"avatar_url":"https://avatars.githubusercontent.com/u/94267?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcnamara","html_url":"https://github.com/jmcnamara","followers_url":"https://api.github.com/users/jmcnamara/followers","following_url":"https://api.github.com/users/jmcnamara/following{/other_user}","gists_url":"https://api.github.com/users/jmcnamara/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcnamara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcnamara/subscriptions","organizations_url":"https://api.github.com/users/jmcnamara/orgs","repos_url":"https://api.github.com/users/jmcnamara/repos","events_url":"https://api.github.com/users/jmcnamara/events{/privacy}","received_events_url":"https://api.github.com/users/jmcnamara/received_events","type":"User","site_admin":false},"created_at":"2015-09-17T09:29:06Z","updated_at":"2015-09-17T09:29:06Z","body":"@jorisvandenbossche I can work on a fix at the weekend."}}