<jupyter_start><jupyter_text>CW 13 - Understanding Jit with Numba <NAME> and <NAME>12/15/17<jupyter_code>def julia(c):
    #@np.vectorize  #comment for numba
    @nb.vectorize #uncomment for numba
    def j(z):
        for n in range(100):
            z = z**2 + c
            if abs(z) > 2:
                return n
        return 0
    return j

j = julia(0.345 + 0.45j)

@nb.jit  #uncomment for numba
def cplane(min=-1.5, max=1.5, points=10000):
    r = np.linspace(-1.5, 1.5, 10000)
    x, y = np.meshgrid(r,r)
    z = x + y * 1j
    return z

%time z = cplane()
%time jset = j(z)

plt.figure(1, (20,15))
plt.imshow(jset, cmap=plt.cm.bone)
plt.xticks([])
plt.yticks([])
plt.title("Julia Set : c = 0.345 + 0.45j")
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16380449141347425, 'fraction_numerical': 0.06869220607661823, 'mean_word_length': 2.542056074766355, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '553223', 'license': 'MIT', 'n_tokens_mistral': 368, 'n_tokens_neox': 326, 'n_words': 78, 'path': 'cw13-juliasets.ipynb', 'repo_name': 'chapman-phys220-2017f/cw-13-riley-nikki', 'size': '772'}