<jupyter_start><jupyter_text>Classwork 07<NAME>, <NAME>10-11-2018 InstructionsFirst, go through the slides indicated in the README and place any code fragments to test in the following subsection. Second, go through the rest of the notebook, execute lines to test them, and complete the coding assignments. Slide Scratch Work  DescriptionThe following code benchmarks and plots functions approximated both as python lists and as numpy arrays. Module DocumentationFor illustration, here is a reminder of how the python help system naturally uses the docstrings from the code.<jupyter_code>help(cw07.gen_gaussian_list)
?cw07.gen_gaussian_array<jupyter_output><empty_output><jupyter_text>Python ListsBenchmark and plot the reference list implementation.  Gaussian Function<jupyter_code>%time x, g = cw07.gen_gaussian_list(-10,10,1000001)
gauss = pd.DataFrame({"x":x,"g(x)":g})
gauss.plot(x="x",y="g(x)")<jupyter_output><empty_output><jupyter_text>sinc Function<jupyter_code>%time x, g = cw07.gen_sinc_list(-20,20,1000001)
sinc = pd.DataFrame({"x":x,"g(x)":g})
sinc.plot(x="x",y="g(x)")<jupyter_output><empty_output><jupyter_text>sinf Function<jupyter_code>%time x, g = cw07.gen_sinf_list(-2.5,2.5,1000001)
sinf = pd.DataFrame({"x":x,"g(x)":g})
sinf.plot(x="x",y="g(x)")<jupyter_output><empty_output><jupyter_text>Numpy Arrays  Gaussian Function<jupyter_code>%time x, g = cw07.gen_gaussian_array(-10, 10, 1000001)
gauss = pd.DataFrame({"x":x,"g(x)":g})
gauss.plot(x="x",y="g(x)")<jupyter_output><empty_output><jupyter_text>sinc Function<jupyter_code>%time x, g = cw07.gen_sinc_array(-20, 20, 1000001)
sinc = pd.DataFrame({"x":x,"g(x)":g})
sinc.plot(x="x",y="g(x)")<jupyter_output><empty_output><jupyter_text>sinf Function<jupyter_code>%time x, g = cw07.gen_sinf_array(-2.5, 2.5, 1000001)
sinf = pd.DataFrame({"x":x,"g(x)":g})
sinf.plot(x="x",y="g(x)")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15982951518380395, 'fraction_numerical': 0.049014384656366546, 'mean_word_length': 8.832460732984293, 'pattern_counts': {'":': 12, '<': 31, '<?xml version=': 0, '>': 31, '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': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '638528', 'license': 'MIT', 'n_tokens_mistral': 807, 'n_tokens_neox': 747, 'n_words': 139, 'path': 'cw07.ipynb', 'repo_name': 'chapman-phys220-2018f/cw07-cw07-thegoblins', 'size': '1884'}