{"action":"created","issue":{"url":"https://api.github.com/repos/rootpy/root_numpy/issues/221","labels_url":"https://api.github.com/repos/rootpy/root_numpy/issues/221/labels{/name}","comments_url":"https://api.github.com/repos/rootpy/root_numpy/issues/221/comments","events_url":"https://api.github.com/repos/rootpy/root_numpy/issues/221/events","html_url":"https://github.com/rootpy/root_numpy/issues/221","id":108307901,"number":221,"title":"Convert numpy recarrays with subarrays to branches with more than 1 value","user":{"login":"MaxNoe","id":5488440,"avatar_url":"https://avatars.githubusercontent.com/u/5488440?v=3","gravatar_id":"","url":"https://api.github.com/users/MaxNoe","html_url":"https://github.com/MaxNoe","followers_url":"https://api.github.com/users/MaxNoe/followers","following_url":"https://api.github.com/users/MaxNoe/following{/other_user}","gists_url":"https://api.github.com/users/MaxNoe/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxNoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxNoe/subscriptions","organizations_url":"https://api.github.com/users/MaxNoe/orgs","repos_url":"https://api.github.com/users/MaxNoe/repos","events_url":"https://api.github.com/users/MaxNoe/events{/privacy}","received_events_url":"https://api.github.com/users/MaxNoe/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-25T11:29:03Z","updated_at":"2015-09-25T14:44:29Z","closed_at":"2015-09-25T14:41:14Z","body":"It would be nice if  `root_numpy` could also convert recarrays with subarrays (`dtype('key', dtype, N)`) to root trees with branches `dtype[N]`.\r\n\r\nAnalog to:\r\n\r\n```{python}\r\n\r\nimport ROOT\r\nimport numpy as np\r\n\r\nf = ROOT.TFile('test.root', 'RECREATE')\r\n\r\narray = np.zeros(2)\r\n\r\ntree = ROOT.TTree('test', 'test')\r\nbranch = tree.Branch('test_array', array, 'D[2]')\r\nfor i in range(10):\r\n    a = np.random.normal(0, 1, size=2)\r\n    tree.Fill()\r\n\r\ntree.Write()\r\nf.Close()\r\n```\r\n\r\nThis fails:\r\n\r\n``` {python}\r\nimport numpy as np\r\nfrom root_numpy import array2root\r\n\r\narray = np.array([\r\n    ([1.0, 2.0], 3), \r\n    ([2.0, 3.0], 6), \r\n], dtype=[('test_array', float, 2), ('test_number', float)]\r\n)\r\narray2root(array, 'test.root', 'test')\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/rootpy/root_numpy/issues/comments/143242125","html_url":"https://github.com/rootpy/root_numpy/issues/221#issuecomment-143242125","issue_url":"https://api.github.com/repos/rootpy/root_numpy/issues/221","id":143242125,"user":{"login":"MaxNoe","id":5488440,"avatar_url":"https://avatars.githubusercontent.com/u/5488440?v=3","gravatar_id":"","url":"https://api.github.com/users/MaxNoe","html_url":"https://github.com/MaxNoe","followers_url":"https://api.github.com/users/MaxNoe/followers","following_url":"https://api.github.com/users/MaxNoe/following{/other_user}","gists_url":"https://api.github.com/users/MaxNoe/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxNoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxNoe/subscriptions","organizations_url":"https://api.github.com/users/MaxNoe/orgs","repos_url":"https://api.github.com/users/MaxNoe/repos","events_url":"https://api.github.com/users/MaxNoe/events{/privacy}","received_events_url":"https://api.github.com/users/MaxNoe/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T14:44:29Z","updated_at":"2015-09-25T14:44:29Z","body":"awesome!"}}