{"action":"created","issue":{"url":"https://api.github.com/repos/astropy/astropy/issues/5913","repository_url":"https://api.github.com/repos/astropy/astropy","labels_url":"https://api.github.com/repos/astropy/astropy/issues/5913/labels{/name}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/5913/comments","events_url":"https://api.github.com/repos/astropy/astropy/issues/5913/events","html_url":"https://github.com/astropy/astropy/issues/5913","id":217261019,"number":5913,"title":"Table indexing cannot be used to update a table","user":{"login":"saimn","id":311639,"avatar_url":"https://avatars0.githubusercontent.com/u/311639?v=4","gravatar_id":"","url":"https://api.github.com/users/saimn","html_url":"https://github.com/saimn","followers_url":"https://api.github.com/users/saimn/followers","following_url":"https://api.github.com/users/saimn/following{/other_user}","gists_url":"https://api.github.com/users/saimn/gists{/gist_id}","starred_url":"https://api.github.com/users/saimn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saimn/subscriptions","organizations_url":"https://api.github.com/users/saimn/orgs","repos_url":"https://api.github.com/users/saimn/repos","events_url":"https://api.github.com/users/saimn/events{/privacy}","received_events_url":"https://api.github.com/users/saimn/received_events","type":"User","site_admin":false},"labels":[{"id":35762381,"url":"https://api.github.com/repos/astropy/astropy/labels/Effort-low","name":"Effort-low","color":"fef2c0","default":false},{"id":181675,"url":"https://api.github.com/repos/astropy/astropy/labels/Feature%20Request","name":"Feature Request","color":"bfdadc","default":false},{"id":113315579,"url":"https://api.github.com/repos/astropy/astropy/labels/Package-novice","name":"Package-novice","color":"bfe5bf","default":false},{"id":229192,"url":"https://api.github.com/repos/astropy/astropy/labels/table","name":"table","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2017-03-27T14:18:07Z","updated_at":"2017-11-10T15:58:37Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"If I have an index on a column, I can use it to retrieve a list of rows with `.loc`, but then it seems there is no way to update the corresponding rows in the source table:\r\n```python\r\nIn [1]: %astropy\r\nNumpy 1.12.0\r\nAstropy 2.0.dev18049\r\n\r\nIn [2]: t = Table([list('abcde'), list(range(5))])\r\n\r\nIn [3]: t\r\nOut[3]: \r\n<Table length=5>\r\ncol0  col1\r\nstr1 int64\r\n---- -----\r\n   a     0\r\n   b     1\r\n   c     2\r\n   d     3\r\n   e     4\r\n\r\nIn [4]: t.add_index('col0')\r\n\r\nIn [5]: t.loc[['a', 'c']]\r\nOut[5]: \r\n<Table length=2>\r\ncol0  col1\r\nstr1 int64\r\n---- -----\r\n   a     0\r\n   c     2\r\n\r\nIn [6]: t.loc[['a', 'c']]['col1'] = 10\r\n\r\nIn [7]: t\r\nOut[7]: \r\n<Table length=5>\r\ncol0  col1\r\nstr1 int64\r\n---- -----\r\n   a     0\r\n   b     1\r\n   c     2\r\n   d     3\r\n   e     4\r\n```\r\nI can understand this because it uses Numpy's fancy indexing which makes a copy, but then something that would be useful is a way to get the list of indices of these rows in the source table. It is computed (https://github.com/astropy/astropy/blob/master/astropy/table/index.py#L818) but currently it's not possible to retrieve this. Maybe with a `TableLoc.get_indices` method or something similar ?\r\nping @taldcroft"},"comment":{"url":"https://api.github.com/repos/astropy/astropy/issues/comments/343511633","html_url":"https://github.com/astropy/astropy/issues/5913#issuecomment-343511633","issue_url":"https://api.github.com/repos/astropy/astropy/issues/5913","id":343511633,"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},"created_at":"2017-11-10T15:58:37Z","updated_at":"2017-11-10T15:58:37Z","author_association":"NONE","body":"@saimn kindly check it and send me your valuable feedback!\r\n#6831"}}
{"actor":{"display_login":"sushobhana"}}