{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/10043","labels_url":"https://api.github.com/repos/pydata/pandas/issues/10043/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/10043/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/10043/events","html_url":"https://github.com/pydata/pandas/issues/10043","id":72474981,"number":10043,"title":"iloc breaks on read-only dataframe","user":{"login":"amueller","id":449558,"avatar_url":"https://avatars.githubusercontent.com/u/449558?v=3","gravatar_id":"","url":"https://api.github.com/users/amueller","html_url":"https://github.com/amueller","followers_url":"https://api.github.com/users/amueller/followers","following_url":"https://api.github.com/users/amueller/following{/other_user}","gists_url":"https://api.github.com/users/amueller/gists{/gist_id}","starred_url":"https://api.github.com/users/amueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amueller/subscriptions","organizations_url":"https://api.github.com/users/amueller/orgs","repos_url":"https://api.github.com/users/amueller/repos","events_url":"https://api.github.com/users/amueller/events{/privacy}","received_events_url":"https://api.github.com/users/amueller/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/Indexing","name":"Indexing","color":"0b02e1"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-05-01T17:05:44Z","updated_at":"2015-05-01T20:38:58Z","closed_at":null,"body":"This is picking up #9928 again. I don't know if the behavior is expected, but it is a bit odd to me. Maybe I'm doing something wrong, I'm not that familiar with the pandas internals.\r\n\r\nWe call ``df.iloc[indices]`` and that breaks with a read-only dataframe. I feel that it shouldn't though, as it is not writing.\r\n\r\nMinimal reproducing example:\r\n```python\r\nimport pandas as pd\r\nimport numpy as np\r\narray = np.eye(10)\r\narray.setflags(write=False)\r\n\r\nX = pd.DataFrame(array)\r\nX.iloc[[1, 2, 3]]\r\n```\r\n> ValueError buffer source array is read-only\r\n\r\nIs there a way to slice the rows of the dataframe in another way that doesn't need a writeable array?"},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/98230569","html_url":"https://github.com/pydata/pandas/issues/10043#issuecomment-98230569","issue_url":"https://api.github.com/repos/pydata/pandas/issues/10043","id":98230569,"user":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars.githubusercontent.com/u/1217238?v=3","gravatar_id":"","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","followers_url":"https://api.github.com/users/shoyer/followers","following_url":"https://api.github.com/users/shoyer/following{/other_user}","gists_url":"https://api.github.com/users/shoyer/gists{/gist_id}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"created_at":"2015-05-01T20:38:58Z","updated_at":"2015-05-01T20:38:58Z","body":"@amueller The problem with calling `np.array` is that you're copying the data... which is generally not ideal (especially for a routine like `.iloc`, which is supposed to be fast)."}}