<jupyter_start><jupyter_text>The Python Debugger a quick introduction![]() Prof. <NAME>&copy; 2019 <NAME>  In this tutorial you will... - Become aware of the debugger built in to python- Use the debugger to figure out why a code segment fails to execute  Write some (buggy) code<jupyter_code>for x in range(10):
    print(1/x)<jupyter_output><empty_output><jupyter_text>Start the debugger  A slightly less trivial example<jupyter_code>from astropy.stats import LombScargle
def myfunc(x, y):
    frequency, power = LombScargle(x, y).autopower()
    return frequency, power
import numpy as np
x = np.linspace(0, 100, 1000)
y = np.random.normal(size=100)
myfunc(x, y)
debug<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10285714285714286, 'fraction_numerical': 0.025714285714285714, 'mean_word_length': 5.431192660550459, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '346871', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 254, 'n_tokens_neox': 235, 'n_words': 78, 'path': 'python.debugger.ipynb', 'repo_name': 'sandeep-rout/Astronomical_Techniques', 'size': '714'}