{"action":"created","comment":{"url":"https://api.github.com/repos/astropy/astropy/pulls/comments/151392489","pull_request_review_id":77086336,"id":151392489,"diff_hunk":"@@ -817,13 +808,73 @@ def __getitem__(self, item):\n             rows = []\n             for key in item:\n                 rows.extend(index.find((key,)))\n+        return rows\n+\n+    def __getitem__(self, item):\n+        '''\n+        Retrieve Table rows by value slice.\n+\n+        Parameters\n+        ----------\n+        item : column element, list, ndarray, slice or tuple\n+            Can be a value of the table primary index, a list/ndarray\n+            of such values, or a value slice (both endpoints are included).\n+            If a tuple is provided, the first element must be\n+            an index to use instead of the primary key, and the\n+            second element must be as above.\n+        '''\n+        rows = self._get_rows(item)\n \n         if len(rows) == 0:  # no matches found\n             raise KeyError('No matches found for key {0}'.format(item))\n         elif len(rows) == 1:  # single row\n             return self.table[rows[0]]\n         return self.table[rows]\n \n+    def __setitem__(self, key, value):\n+        '''\n+            assign Table row's indices  by value slice.\n+\n+            Parameters\n+                        ----------\n+            key : column element, list, ndarray, slice or tuple\n+                  Can be a value of the table primary index, a list/ndarray\n+                  of such values, or a value slice (both endpoints are included).\n+                  If a tuple is provided, the first element must be\n+                  an index to use instead of the primary key, and the\n+                  second element must be as above.\n+\n+            value : New values of the row elements.\n+                    Can be a list of tuples/lists to update the row.\n+        '''\n+        rows = self._get_rows(key)\n+        if len(rows) == 0:  # no matches found\n+            raise KeyError('No matches found for key {0}'.format(key))\n+        elif len(rows) == 1:  # single row\n+            self.table[rows[0]] = value\n+        else:  # multiple rows\n+            for i, row in enumerate(rows):\n+                self.table[row] = value[i]\n+\n+\n+class TableLocIndices(TableLoc):\n+\n+\n+    def __getitem__(self, item):\n+        '''\n+            Retrieve Table row's indices by value slice.\n+\n+            Parameters\n+                ----------\n+            item : column element, list, ndarray, slice or tuple\n+                   Can be a value of the table primary index, a list/ndarray\n+                   of such values, or a value slice (both endpoints are included).\n+                   If a tuple is provided, the first element must be\n+                   an index to use instead of the primary key, and the\n+                   second element must be as above.\n+        '''\n+        return self._get_rows(item)","path":"astropy/table/index.py","position":90,"original_position":90,"commit_id":"5e1e458dad127b1b913e7b809f335c2b58082537","original_commit_id":"5e1e458dad127b1b913e7b809f335c2b58082537","user":{"login":"taldcroft","id":348089,"avatar_url":"https://avatars1.githubusercontent.com/u/348089?v=4","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},"body":"For consistency with `loc` and `iloc` this should return a scalar if the number of matched rows is 1.  (With those two properties one gets back either a `Table` (multiple matches in `_get_rows`) or a \"scalar\" `Row` object (one match).","created_at":"2017-11-16T11:50:58Z","updated_at":"2017-11-16T11:57:19Z","html_url":"https://github.com/astropy/astropy/pull/6831#discussion_r151392489","pull_request_url":"https://api.github.com/repos/astropy/astropy/pulls/6831","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments/151392489"},"html":{"href":"https://github.com/astropy/astropy/pull/6831#discussion_r151392489"},"pull_request":{"href":"https://api.github.com/repos/astropy/astropy/pulls/6831"}}},"pull_request":{"url":"https://api.github.com/repos/astropy/astropy/pulls/6831","id":151940647,"html_url":"https://github.com/astropy/astropy/pull/6831","diff_url":"https://github.com/astropy/astropy/pull/6831.diff","patch_url":"https://github.com/astropy/astropy/pull/6831.patch","issue_url":"https://api.github.com/repos/astropy/astropy/issues/6831","number":6831,"state":"open","locked":false,"title":"Allow updating a Table using indices","user":{"login":"sushobhana","id":22423652,"avatar_url":"https://avatars0.githubusercontent.com/u/22423652?v=4","gravatar_id":"","url":"https://api.github.com/users/sushobhana","html_url":"https://github.com/sushobhana","followers_url":"https://api.github.com/users/sushobhana/followers","following_url":"https://api.github.com/users/sushobhana/following{/other_user}","gists_url":"https://api.github.com/users/sushobhana/gists{/gist_id}","starred_url":"https://api.github.com/users/sushobhana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sushobhana/subscriptions","organizations_url":"https://api.github.com/users/sushobhana/orgs","repos_url":"https://api.github.com/users/sushobhana/repos","events_url":"https://api.github.com/users/sushobhana/events{/privacy}","received_events_url":"https://api.github.com/users/sushobhana/received_events","type":"User","site_admin":false},"body":"EDIT: Fix #5913","created_at":"2017-11-10T15:52:50Z","updated_at":"2017-11-16T11:57:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d94a3ba4664e7f88da275907bfa679485da282f","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/astropy/astropy/milestones/45","html_url":"https://github.com/astropy/astropy/milestone/45","labels_url":"https://api.github.com/repos/astropy/astropy/milestones/45/labels","id":2300822,"number":45,"title":"v3.0.0","description":null,"creator":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars2.githubusercontent.com/u/314716?v=4","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},"open_issues":62,"closed_issues":123,"state":"open","created_at":"2017-02-05T19:05:19Z","updated_at":"2017-11-15T21:48:31Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/astropy/astropy/pulls/6831/commits","review_comments_url":"https://api.github.com/repos/astropy/astropy/pulls/6831/comments","review_comment_url":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/6831/comments","statuses_url":"https://api.github.com/repos/astropy/astropy/statuses/5e1e458dad127b1b913e7b809f335c2b58082537","head":{"label":"sushobhana:my-own-astropy","ref":"my-own-astropy","sha":"5e1e458dad127b1b913e7b809f335c2b58082537","user":{"login":"sushobhana","id":22423652,"avatar_url":"https://avatars0.githubusercontent.com/u/22423652?v=4","gravatar_id":"","url":"https://api.github.com/users/sushobhana","html_url":"https://github.com/sushobhana","followers_url":"https://api.github.com/users/sushobhana/followers","following_url":"https://api.github.com/users/sushobhana/following{/other_user}","gists_url":"https://api.github.com/users/sushobhana/gists{/gist_id}","starred_url":"https://api.github.com/users/sushobhana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sushobhana/subscriptions","organizations_url":"https://api.github.com/users/sushobhana/orgs","repos_url":"https://api.github.com/users/sushobhana/repos","events_url":"https://api.github.com/users/sushobhana/events{/privacy}","received_events_url":"https://api.github.com/users/sushobhana/received_events","type":"User","site_admin":false},"repo":{"id":108810683,"name":"astropy","full_name":"sushobhana/astropy","owner":{"login":"sushobhana","id":22423652,"avatar_url":"https://avatars0.githubusercontent.com/u/22423652?v=4","gravatar_id":"","url":"https://api.github.com/users/sushobhana","html_url":"https://github.com/sushobhana","followers_url":"https://api.github.com/users/sushobhana/followers","following_url":"https://api.github.com/users/sushobhana/following{/other_user}","gists_url":"https://api.github.com/users/sushobhana/gists{/gist_id}","starred_url":"https://api.github.com/users/sushobhana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sushobhana/subscriptions","organizations_url":"https://api.github.com/users/sushobhana/orgs","repos_url":"https://api.github.com/users/sushobhana/repos","events_url":"https://api.github.com/users/sushobhana/events{/privacy}","received_events_url":"https://api.github.com/users/sushobhana/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sushobhana/astropy","description":"Repository for the Astropy core package","fork":true,"url":"https://api.github.com/repos/sushobhana/astropy","forks_url":"https://api.github.com/repos/sushobhana/astropy/forks","keys_url":"https://api.github.com/repos/sushobhana/astropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sushobhana/astropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sushobhana/astropy/teams","hooks_url":"https://api.github.com/repos/sushobhana/astropy/hooks","issue_events_url":"https://api.github.com/repos/sushobhana/astropy/issues/events{/number}","events_url":"https://api.github.com/repos/sushobhana/astropy/events","assignees_url":"https://api.github.com/repos/sushobhana/astropy/assignees{/user}","branches_url":"https://api.github.com/repos/sushobhana/astropy/branches{/branch}","tags_url":"https://api.github.com/repos/sushobhana/astropy/tags","blobs_url":"https://api.github.com/repos/sushobhana/astropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sushobhana/astropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sushobhana/astropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/sushobhana/astropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sushobhana/astropy/statuses/{sha}","languages_url":"https://api.github.com/repos/sushobhana/astropy/languages","stargazers_url":"https://api.github.com/repos/sushobhana/astropy/stargazers","contributors_url":"https://api.github.com/repos/sushobhana/astropy/contributors","subscribers_url":"https://api.github.com/repos/sushobhana/astropy/subscribers","subscription_url":"https://api.github.com/repos/sushobhana/astropy/subscription","commits_url":"https://api.github.com/repos/sushobhana/astropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/sushobhana/astropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/sushobhana/astropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/sushobhana/astropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/sushobhana/astropy/contents/{+path}","compare_url":"https://api.github.com/repos/sushobhana/astropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sushobhana/astropy/merges","archive_url":"https://api.github.com/repos/sushobhana/astropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sushobhana/astropy/downloads","issues_url":"https://api.github.com/repos/sushobhana/astropy/issues{/number}","pulls_url":"https://api.github.com/repos/sushobhana/astropy/pulls{/number}","milestones_url":"https://api.github.com/repos/sushobhana/astropy/milestones{/number}","notifications_url":"https://api.github.com/repos/sushobhana/astropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sushobhana/astropy/labels{/name}","releases_url":"https://api.github.com/repos/sushobhana/astropy/releases{/id}","deployments_url":"https://api.github.com/repos/sushobhana/astropy/deployments","created_at":"2017-10-30T06:28:41Z","updated_at":"2017-10-30T06:28:47Z","pushed_at":"2017-11-15T21:22:35Z","git_url":"git://github.com/sushobhana/astropy.git","ssh_url":"git@github.com:sushobhana/astropy.git","clone_url":"https://github.com/sushobhana/astropy.git","svn_url":"https://github.com/sushobhana/astropy","homepage":"www.astropy.org","size":62070,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"astropy:master","ref":"master","sha":"4feae636ba34cb47e69a7a99e499aefec5c82b60","user":{"login":"astropy","id":847984,"avatar_url":"https://avatars0.githubusercontent.com/u/847984?v=4","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://avatars0.githubusercontent.com/u/847984?v=4","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}","deployments_url":"https://api.github.com/repos/astropy/astropy/deployments","created_at":"2011-07-21T01:33:49Z","updated_at":"2017-11-14T16:04:03Z","pushed_at":"2017-11-16T11:20:25Z","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":62418,"stargazers_count":1459,"watchers_count":1459,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":780,"mirror_url":null,"archived":false,"open_issues_count":824,"forks":780,"open_issues":824,"watchers":1459,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/6831"},"html":{"href":"https://github.com/astropy/astropy/pull/6831"},"issue":{"href":"https://api.github.com/repos/astropy/astropy/issues/6831"},"comments":{"href":"https://api.github.com/repos/astropy/astropy/issues/6831/comments"},"review_comments":{"href":"https://api.github.com/repos/astropy/astropy/pulls/6831/comments"},"review_comment":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/astropy/astropy/pulls/6831/commits"},"statuses":{"href":"https://api.github.com/repos/astropy/astropy/statuses/5e1e458dad127b1b913e7b809f335c2b58082537"}},"author_association":"NONE"}}
{"actor":{"display_login":"taldcroft"}}