{"id":1075,"date":"2020-07-15T14:35:59","date_gmt":"2020-07-15T20:35:59","guid":{"rendered":"http:\/\/www.gergltd.com\/home\/?p=1075"},"modified":"2020-07-17T13:34:46","modified_gmt":"2020-07-17T19:34:46","slug":"cryptic-numba-error-use-parentheses-for-numpy-array-not-brackets","status":"publish","type":"post","link":"https:\/\/www.gergltd.com\/home\/cryptic-numba-error-use-parentheses-for-numpy-array-not-brackets\/","title":{"rendered":"Cryptic Numba Error &#8211; Use Parentheses for numpy.array, Not Brackets"},"content":{"rendered":"<p>I am writing a fairly complicated Numba code and kept getting a cryptic error which took me a few hours to figure out.\u00a0 The error was the following:<\/p>\n<pre>numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)\r\nNo implementation of function Function(&lt;built-in function array&gt;) found for signature:\r\n&gt;&gt;&gt; array(array(float64, 1d, C))\r\nThere are 2 candidate implementations:\r\n- Of which 2 did not match due to:\r\nOverload in function 'array': File: numba\/core\/typing\/npydecl.py: Line 504.\r\nWith argument(s): '(array(float64, 1d, C))':\r\nRejected as the implementation raised a specific error:\r\n... (truncated)<\/pre>\n<p>I discovered that the problem was the result of creating new numpy arrays using lists instead of tuples.\u00a0 So instead of np.array([1,2,3]), I was supposed to do np.array((1,2,3)).\u00a0 That&#8217;s it!<\/p>\n<p>I found the solution by reading the Numba documentation (https:\/\/numba.pydata.org\/numba-doc\/latest\/reference\/numpysupported.html)<\/p>\n<blockquote><p>(nested lists are not yet supported by Numba)<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>I am writing a fairly complicated Numba code and kept getting a cryptic error which took me a few hours to figure out.\u00a0 The error was the following: numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) No implementation of function Function(&lt;built-in function array&gt;) found for signature: &gt;&gt;&gt; array(array(float64, 1d, C)) There are 2 candidate [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_exactmetrics_skip_tracking":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1075","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/posts\/1075","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/comments?post=1075"}],"version-history":[{"count":2,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/posts\/1075\/revisions"}],"predecessor-version":[{"id":1077,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/posts\/1075\/revisions\/1077"}],"wp:attachment":[{"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/media?parent=1075"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/categories?post=1075"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/tags?post=1075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}