{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/12353","repository_url":"https://api.github.com/repos/pydata/pandas","labels_url":"https://api.github.com/repos/pydata/pandas/issues/12353/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/12353/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/12353/events","html_url":"https://github.com/pydata/pandas/issues/12353","id":134036459,"number":12353,"title":"Supplying an xarray Dataset to DataFrame constructor breaks","user":{"login":"MaximilianR","id":5635139,"avatar_url":"https://avatars.githubusercontent.com/u/5635139?v=3","gravatar_id":"","url":"https://api.github.com/users/MaximilianR","html_url":"https://github.com/MaximilianR","followers_url":"https://api.github.com/users/MaximilianR/followers","following_url":"https://api.github.com/users/MaximilianR/following{/other_user}","gists_url":"https://api.github.com/users/MaximilianR/gists{/gist_id}","starred_url":"https://api.github.com/users/MaximilianR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaximilianR/subscriptions","organizations_url":"https://api.github.com/users/MaximilianR/orgs","repos_url":"https://api.github.com/users/MaximilianR/repos","events_url":"https://api.github.com/users/MaximilianR/events{/privacy}","received_events_url":"https://api.github.com/users/MaximilianR/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/Compat","name":"Compat","color":"0052cc"},{"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/40","html_url":"https://github.com/pydata/pandas/milestones/0.18.2","labels_url":"https://api.github.com/repos/pydata/pandas/milestones/40/labels","id":1639795,"number":40,"title":"0.18.2","description":"","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":132,"closed_issues":1,"state":"open","created_at":"2016-03-11T21:24:45Z","updated_at":"2016-04-27T11:37:59Z","due_on":"2016-06-14T04:00:00Z","closed_at":null},"comments":15,"created_at":"2016-02-16T17:01:56Z","updated_at":"2016-04-27T18:52:48Z","closed_at":null,"body":"```python\r\n\r\nIn [1]: import xarray as xr\r\n\r\nIn [2]: import pandas as pd\r\n\r\nIn [3]: df = pd.DataFrame({'a': pd.np.random.rand(10), 'b': pd.np.random.rand(10)})\r\n\r\nIn [4]: df\r\nOut[4]: \r\n          a         b\r\n0  0.711341  0.636954\r\n1  0.199090  0.370938\r\n2  0.486677  0.274427\r\n3  0.407370  0.282419\r\n4  0.760676  0.069163\r\n5  0.098402  0.820085\r\n6  0.710977  0.777998\r\n7  0.687722  0.764163\r\n8  0.297734  0.740927\r\n9  0.554381  0.388324\r\n\r\nIn [5]: xr.Dataset(df)\r\nOut[5]: \r\n<xarray.Dataset>\r\nDimensions:  (dim_0: 10)\r\nCoordinates:\r\n  * dim_0    (dim_0) int64 0 1 2 3 4 5 6 7 8 9\r\nData variables:\r\n    a        (dim_0) float64 0.7113 0.1991 0.4867 0.4074 0.7607 0.0984 0.711 ...\r\n    b        (dim_0) float64 0.637 0.3709 0.2744 0.2824 0.06916 0.8201 0.778 ...\r\n\r\nIn [6]: pd.DataFrame(xr.Dataset(df))\r\n---------------------------------------------------------------------------\r\nPandasError                               Traceback (most recent call last)\r\n<ipython-input-6-be1c7b096414> in <module>()\r\n----> 1 pd.DataFrame(xr.Dataset(df))\r\n\r\n/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pandas/core/frame.py in __init__(self, data, index, columns, dtype, copy)\r\n    303                                          copy=False)\r\n    304             else:\r\n--> 305                 raise PandasError('DataFrame constructor not properly called!')\r\n    306 \r\n    307         NDFrame.__init__(self, mgr, fastpath=True)\r\n\r\nPandasError: DataFrame constructor not properly called!\r\n```\r\n\r\nI _think_ because this looks for `dict` rather than 'dict-like' or `Mapping`: https://github.com/pydata/pandas/blob/master/pandas/core/frame.py#L222\r\n"},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/215191800","html_url":"https://github.com/pydata/pandas/issues/12353#issuecomment-215191800","issue_url":"https://api.github.com/repos/pydata/pandas/issues/12353","id":215191800,"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-04-27T18:52:48Z","updated_at":"2016-04-27T18:52:48Z","body":"its not strictly necessary to inherit from ``Mapping`` to be dict-like. In fact that's the new 'way'. I don't have a problem with that actually."}}