{"action":"opened","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/8108","repository_url":"https://api.github.com/repos/numpy/numpy","labels_url":"https://api.github.com/repos/numpy/numpy/issues/8108/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/8108/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/8108/events","html_url":"https://github.com/numpy/numpy/issues/8108","id":180488617,"number":8108,"title":"Can't do a formatted print of a <class 'numpy.core.memmap.memmap'> returned by a.mean(a)","user":{"login":"Christopher-Field","id":18728264,"avatar_url":"https://avatars.githubusercontent.com/u/18728264?v=3","gravatar_id":"","url":"https://api.github.com/users/Christopher-Field","html_url":"https://github.com/Christopher-Field","followers_url":"https://api.github.com/users/Christopher-Field/followers","following_url":"https://api.github.com/users/Christopher-Field/following{/other_user}","gists_url":"https://api.github.com/users/Christopher-Field/gists{/gist_id}","starred_url":"https://api.github.com/users/Christopher-Field/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Christopher-Field/subscriptions","organizations_url":"https://api.github.com/users/Christopher-Field/orgs","repos_url":"https://api.github.com/users/Christopher-Field/repos","events_url":"https://api.github.com/users/Christopher-Field/events{/privacy}","received_events_url":"https://api.github.com/users/Christopher-Field/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-02T00:56:30Z","updated_at":"2016-10-02T00:56:30Z","closed_at":null,"body":"The second line of the program fragment below succeeds if b is a regular numpy array\r\nbut generates a TypeError if b is a memory mapped array (memmap).\r\n\r\nm2 = b.mean()\r\nprint(\"The mean of b is {:f}.\".format(m2))\r\n\r\nTypeError: non-empty format string passed to object.__format__\r\n\r\nThe work around is a specific type change as \r\nprint(\"The mean of b is {:f}.\".format(float(m2)))\r\n\r\nA program demonstrating the success and failure is attached. I have observed the error in python 2.7 with numpy 1.10.4, python 3.5 with numpy 1.10.4, and pythion 3.5 with numpy 1.11.1.\r\nI am running OS X 10.10.5.\r\n\r\n[memmap_error.py.zip](https://github.com/numpy/numpy/files/504729/memmap_error.py.zip)\r\n\r\n"}}
{"actor":{"display_login":"Christopher-Field"}}