{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/7542","repository_url":"https://api.github.com/repos/numpy/numpy","labels_url":"https://api.github.com/repos/numpy/numpy/issues/7542/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/7542/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/7542/events","html_url":"https://github.com/numpy/numpy/pull/7542","id":147901548,"number":7542,"title":"ENH: Add `polyvalfromroots` to numpy.polynomial","user":{"login":"e-q","id":6894112,"avatar_url":"https://avatars.githubusercontent.com/u/6894112?v=3","gravatar_id":"","url":"https://api.github.com/users/e-q","html_url":"https://github.com/e-q","followers_url":"https://api.github.com/users/e-q/followers","following_url":"https://api.github.com/users/e-q/following{/other_user}","gists_url":"https://api.github.com/users/e-q/gists{/gist_id}","starred_url":"https://api.github.com/users/e-q/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e-q/subscriptions","organizations_url":"https://api.github.com/users/e-q/orgs","repos_url":"https://api.github.com/users/e-q/repos","events_url":"https://api.github.com/users/e-q/events{/privacy}","received_events_url":"https://api.github.com/users/e-q/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/numpy/numpy/labels/09%20-%20Enhancement","name":"09 - Enhancement","color":"fef2c0"},{"url":"https://api.github.com/repos/numpy/numpy/labels/component:%20numpy.polynomial","name":"component: numpy.polynomial","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/numpy/numpy/milestones/41","html_url":"https://github.com/numpy/numpy/milestones/1.12.0%20release","labels_url":"https://api.github.com/repos/numpy/numpy/milestones/41/labels","id":1503092,"number":41,"title":"1.12.0 release","description":"Tag for the Numpy 1.12.0 release.","creator":{"login":"charris","id":77272,"avatar_url":"https://avatars.githubusercontent.com/u/77272?v=3","gravatar_id":"","url":"https://api.github.com/users/charris","html_url":"https://github.com/charris","followers_url":"https://api.github.com/users/charris/followers","following_url":"https://api.github.com/users/charris/following{/other_user}","gists_url":"https://api.github.com/users/charris/gists{/gist_id}","starred_url":"https://api.github.com/users/charris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charris/subscriptions","organizations_url":"https://api.github.com/users/charris/orgs","repos_url":"https://api.github.com/users/charris/repos","events_url":"https://api.github.com/users/charris/events{/privacy}","received_events_url":"https://api.github.com/users/charris/received_events","type":"User","site_admin":false},"open_issues":55,"closed_issues":16,"state":"open","created_at":"2016-01-12T20:39:09Z","updated_at":"2016-04-26T01:56:15Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2016-04-12T23:20:17Z","updated_at":"2016-04-28T03:02:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/numpy/numpy/pulls/7542","html_url":"https://github.com/numpy/numpy/pull/7542","diff_url":"https://github.com/numpy/numpy/pull/7542.diff","patch_url":"https://github.com/numpy/numpy/pull/7542.patch"},"body":"As one can easily encounter when working with high-order signal processing\r\nfilters, converting a high-order polynomial from its roots to its polynomial\r\ncoefficients can be quite lossy, leading to inaccuracies in the filter's\r\nproperties.\r\n\r\nI'm proposing a new function, `polyrootval` - based on `polyval` -  that\r\nevaluates a polynomial given a list of its roots. The benefit of calculating it\r\nthis way can be seen at [scipy Issue #6059](https://github.com/scipy/scipy/pull/6059). Some tests are included, as well.\r\n\r\nThere are a few things where I'm not 100% sure what the best choice is, though\r\n - The return value for an empty list of roots is `zeros_like(x)`; maybe there's another value that makes more sense, or even an error?\r\n - How can one specify `-x**n`? `roots=[0]*n` can only give you `x**n`. "},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/215297302","html_url":"https://github.com/numpy/numpy/pull/7542#issuecomment-215297302","issue_url":"https://api.github.com/repos/numpy/numpy/issues/7542","id":215297302,"user":{"login":"charris","id":77272,"avatar_url":"https://avatars.githubusercontent.com/u/77272?v=3","gravatar_id":"","url":"https://api.github.com/users/charris","html_url":"https://github.com/charris","followers_url":"https://api.github.com/users/charris/followers","following_url":"https://api.github.com/users/charris/following{/other_user}","gists_url":"https://api.github.com/users/charris/gists{/gist_id}","starred_url":"https://api.github.com/users/charris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charris/subscriptions","organizations_url":"https://api.github.com/users/charris/orgs","repos_url":"https://api.github.com/users/charris/repos","events_url":"https://api.github.com/users/charris/events{/privacy}","received_events_url":"https://api.github.com/users/charris/received_events","type":"User","site_admin":false},"created_at":"2016-04-28T03:02:37Z","updated_at":"2016-04-28T03:02:37Z","body":"Hmm, and I must apologize. Now that I've understood what I did with `tensor`, I think we can keep it here. The difference was that if `tensor=True`, each column of `r` gets evaluated for every value of `x`, whereas if `tensor=False`, each column of `r` gets evaluated only for the corresponding broadcast value of `x`."}}