{"action":"created","comment":{"url":"https://api.github.com/repos/astropy/astropy/pulls/comments/29048832","id":29048832,"diff_hunk":"@@ -2021,6 +2021,70 @@ def group_by(self, keys):\n \n         return groups.table_group_by(self, keys)\n \n+    def to_pandas(self):\n+        \"\"\"\n+        Return a :class:`pandas.DataFrame` instance\n+\n+        Returns\n+        -------\n+        dataframe : :class:`pandas.DataFrame`\n+            A pandas :class:`pandas.DataFrame` instance\n+        \"\"\"\n+        from pandas import DataFrame\n+\n+        if self.has_mixin_columns:\n+            raise ValueError(\"Cannot convert a table with mixin columns to a pandas DataFrame\")\n+\n+        for column in self.columns:\n+            if len(self.dtype[column].shape) > 0:\n+                raise ValueError(\"Cannot convert a table with multi-dimensional columns to a pandas DataFrame\")\n+\n+        if self.masked:\n+            # We have to add the columns manually so as to treat the mask\n+            # correctly\n+            d = DataFrame()\n+            for name, column in self.columns.items():\n+                if isinstance(column, MaskedColumn):\n+                    if column.dtype.kind in ['i']:","path":"astropy/table/table.py","position":28,"original_position":28,"commit_id":"a2f3d1d37032eb43c11811fe1a9fbaec56664ed9","original_commit_id":"a2f3d1d37032eb43c11811fe1a9fbaec56664ed9","user":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2015-04-24T13:41:36Z","updated_at":"2015-04-24T13:41:36Z","html_url":"https://github.com/astropy/astropy/pull/3504#discussion_r29048832","pull_request_url":"https://api.github.com/repos/astropy/astropy/pulls/3504","_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments/29048832"},"html":{"href":"https://github.com/astropy/astropy/pull/3504#discussion_r29048832"},"pull_request":{"href":"https://api.github.com/repos/astropy/astropy/pulls/3504"}}},"pull_request":{"url":"https://api.github.com/repos/astropy/astropy/pulls/3504","id":29325271,"html_url":"https://github.com/astropy/astropy/pull/3504","diff_url":"https://github.com/astropy/astropy/pull/3504.diff","patch_url":"https://github.com/astropy/astropy/pull/3504.patch","issue_url":"https://api.github.com/repos/astropy/astropy/issues/3504","number":3504,"state":"open","locked":false,"title":"Interface Table to pandas DataFrame","user":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"body":"This is simple but often requested by users. Still needs docs, but let me know if you have any feedback in the mean time.\r\n\r\nRemaining to-dos:\r\n\r\n* [x] Add docs\r\n\r\nCloses https://github.com/astropy/astropy/issues/2804","created_at":"2015-02-14T20:40:26Z","updated_at":"2015-04-24T13:41:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b57d20e3f4771e4e390543c9fe3e4a28e65798c2","assignee":{"login":"taldcroft","id":348089,"avatar_url":"https://avatars.githubusercontent.com/u/348089?v=3","gravatar_id":"","url":"https://api.github.com/users/taldcroft","html_url":"https://github.com/taldcroft","followers_url":"https://api.github.com/users/taldcroft/followers","following_url":"https://api.github.com/users/taldcroft/following{/other_user}","gists_url":"https://api.github.com/users/taldcroft/gists{/gist_id}","starred_url":"https://api.github.com/users/taldcroft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taldcroft/subscriptions","organizations_url":"https://api.github.com/users/taldcroft/orgs","repos_url":"https://api.github.com/users/taldcroft/repos","events_url":"https://api.github.com/users/taldcroft/events{/privacy}","received_events_url":"https://api.github.com/users/taldcroft/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/astropy/astropy/milestones/20","html_url":"https://github.com/astropy/astropy/milestones/v1.1.0","labels_url":"https://api.github.com/repos/astropy/astropy/milestones/20/labels","id":907426,"number":20,"title":"v1.1.0","description":"","creator":{"login":"eteq","id":346587,"avatar_url":"https://avatars.githubusercontent.com/u/346587?v=3","gravatar_id":"","url":"https://api.github.com/users/eteq","html_url":"https://github.com/eteq","followers_url":"https://api.github.com/users/eteq/followers","following_url":"https://api.github.com/users/eteq/following{/other_user}","gists_url":"https://api.github.com/users/eteq/gists{/gist_id}","starred_url":"https://api.github.com/users/eteq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eteq/subscriptions","organizations_url":"https://api.github.com/users/eteq/orgs","repos_url":"https://api.github.com/users/eteq/repos","events_url":"https://api.github.com/users/eteq/events{/privacy}","received_events_url":"https://api.github.com/users/eteq/received_events","type":"User","site_admin":false},"open_issues":31,"closed_issues":14,"state":"open","created_at":"2014-12-17T20:05:23Z","updated_at":"2015-04-16T16:34:09Z","due_on":"2015-07-23T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/astropy/astropy/pulls/3504/commits","review_comments_url":"https://api.github.com/repos/astropy/astropy/pulls/3504/comments","review_comment_url":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/3504/comments","statuses_url":"https://api.github.com/repos/astropy/astropy/statuses/a2f3d1d37032eb43c11811fe1a9fbaec56664ed9","head":{"label":"astrofrog:pandas","ref":"pandas","sha":"a2f3d1d37032eb43c11811fe1a9fbaec56664ed9","user":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"repo":{"id":2576841,"name":"astropy","full_name":"astrofrog/astropy","owner":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/astrofrog/astropy","description":"Main AstroPy repository","fork":true,"url":"https://api.github.com/repos/astrofrog/astropy","forks_url":"https://api.github.com/repos/astrofrog/astropy/forks","keys_url":"https://api.github.com/repos/astrofrog/astropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/astrofrog/astropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/astrofrog/astropy/teams","hooks_url":"https://api.github.com/repos/astrofrog/astropy/hooks","issue_events_url":"https://api.github.com/repos/astrofrog/astropy/issues/events{/number}","events_url":"https://api.github.com/repos/astrofrog/astropy/events","assignees_url":"https://api.github.com/repos/astrofrog/astropy/assignees{/user}","branches_url":"https://api.github.com/repos/astrofrog/astropy/branches{/branch}","tags_url":"https://api.github.com/repos/astrofrog/astropy/tags","blobs_url":"https://api.github.com/repos/astrofrog/astropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/astrofrog/astropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/astrofrog/astropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/astrofrog/astropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/astrofrog/astropy/statuses/{sha}","languages_url":"https://api.github.com/repos/astrofrog/astropy/languages","stargazers_url":"https://api.github.com/repos/astrofrog/astropy/stargazers","contributors_url":"https://api.github.com/repos/astrofrog/astropy/contributors","subscribers_url":"https://api.github.com/repos/astrofrog/astropy/subscribers","subscription_url":"https://api.github.com/repos/astrofrog/astropy/subscription","commits_url":"https://api.github.com/repos/astrofrog/astropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/astrofrog/astropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/astrofrog/astropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/astrofrog/astropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/astrofrog/astropy/contents/{+path}","compare_url":"https://api.github.com/repos/astrofrog/astropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/astrofrog/astropy/merges","archive_url":"https://api.github.com/repos/astrofrog/astropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/astrofrog/astropy/downloads","issues_url":"https://api.github.com/repos/astrofrog/astropy/issues{/number}","pulls_url":"https://api.github.com/repos/astrofrog/astropy/pulls{/number}","milestones_url":"https://api.github.com/repos/astrofrog/astropy/milestones{/number}","notifications_url":"https://api.github.com/repos/astrofrog/astropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/astrofrog/astropy/labels{/name}","releases_url":"https://api.github.com/repos/astrofrog/astropy/releases{/id}","created_at":"2011-10-14T14:58:26Z","updated_at":"2014-06-22T14:17:33Z","pushed_at":"2015-04-01T08:27:32Z","git_url":"git://github.com/astrofrog/astropy.git","ssh_url":"git@github.com:astrofrog/astropy.git","clone_url":"https://github.com/astrofrog/astropy.git","svn_url":"https://github.com/astrofrog/astropy","homepage":"astropy.org","size":38748,"stargazers_count":4,"watchers_count":4,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":4,"default_branch":"master"}},"base":{"label":"astropy:master","ref":"master","sha":"1a2d67e8340fee8157af5fa2c372111edb54d0ca","user":{"login":"astropy","id":847984,"avatar_url":"https://avatars.githubusercontent.com/u/847984?v=3","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"repo":{"id":2081289,"name":"astropy","full_name":"astropy/astropy","owner":{"login":"astropy","id":847984,"avatar_url":"https://avatars.githubusercontent.com/u/847984?v=3","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/astropy/astropy","description":"Repository for the Astropy core package","fork":false,"url":"https://api.github.com/repos/astropy/astropy","forks_url":"https://api.github.com/repos/astropy/astropy/forks","keys_url":"https://api.github.com/repos/astropy/astropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/astropy/astropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/astropy/astropy/teams","hooks_url":"https://api.github.com/repos/astropy/astropy/hooks","issue_events_url":"https://api.github.com/repos/astropy/astropy/issues/events{/number}","events_url":"https://api.github.com/repos/astropy/astropy/events","assignees_url":"https://api.github.com/repos/astropy/astropy/assignees{/user}","branches_url":"https://api.github.com/repos/astropy/astropy/branches{/branch}","tags_url":"https://api.github.com/repos/astropy/astropy/tags","blobs_url":"https://api.github.com/repos/astropy/astropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/astropy/astropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/astropy/astropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/astropy/astropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/astropy/astropy/statuses/{sha}","languages_url":"https://api.github.com/repos/astropy/astropy/languages","stargazers_url":"https://api.github.com/repos/astropy/astropy/stargazers","contributors_url":"https://api.github.com/repos/astropy/astropy/contributors","subscribers_url":"https://api.github.com/repos/astropy/astropy/subscribers","subscription_url":"https://api.github.com/repos/astropy/astropy/subscription","commits_url":"https://api.github.com/repos/astropy/astropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/astropy/astropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/astropy/astropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/astropy/astropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/astropy/astropy/contents/{+path}","compare_url":"https://api.github.com/repos/astropy/astropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/astropy/astropy/merges","archive_url":"https://api.github.com/repos/astropy/astropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/astropy/astropy/downloads","issues_url":"https://api.github.com/repos/astropy/astropy/issues{/number}","pulls_url":"https://api.github.com/repos/astropy/astropy/pulls{/number}","milestones_url":"https://api.github.com/repos/astropy/astropy/milestones{/number}","notifications_url":"https://api.github.com/repos/astropy/astropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/astropy/astropy/labels{/name}","releases_url":"https://api.github.com/repos/astropy/astropy/releases{/id}","created_at":"2011-07-21T01:33:49Z","updated_at":"2015-04-24T13:22:44Z","pushed_at":"2015-04-24T13:39:43Z","git_url":"git://github.com/astropy/astropy.git","ssh_url":"git@github.com:astropy/astropy.git","clone_url":"https://github.com/astropy/astropy.git","svn_url":"https://github.com/astropy/astropy","homepage":"www.astropy.org","size":64599,"stargazers_count":535,"watchers_count":535,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":378,"mirror_url":null,"open_issues_count":495,"forks":378,"open_issues":495,"watchers":535,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/3504"},"html":{"href":"https://github.com/astropy/astropy/pull/3504"},"issue":{"href":"https://api.github.com/repos/astropy/astropy/issues/3504"},"comments":{"href":"https://api.github.com/repos/astropy/astropy/issues/3504/comments"},"review_comments":{"href":"https://api.github.com/repos/astropy/astropy/pulls/3504/comments"},"review_comment":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/astropy/astropy/pulls/3504/commits"},"statuses":{"href":"https://api.github.com/repos/astropy/astropy/statuses/a2f3d1d37032eb43c11811fe1a9fbaec56664ed9"}}}}