<jupyter_start><jupyter_text>heaviside >  numpy.heaviside(t,0)  >  numpy.heaviside(t-1,0)<jupyter_code>import numpy as np
import matplotlib as npl
import matplotlib.pyplot as plt
%matplotlib widget
def x(t):
    # heaviside step function( if x1 = 0 then x2 )
    return np.heaviside(t,0) - np.heaviside(t-1,0)
t = np.linspace(-5,5,1000)

fig = plt.figure(figsize=(6,6))

ax = fig.add_subplot(511)
ax.plot(t,np.heaviside(t,0),label='h(t,0)')
ax.plot(t,np.heaviside(t-1,0),label='h(t-1,0)')
plt.legend()

ax = fig.add_subplot(512)
ax.plot(t,np.heaviside(t,0)-np.heaviside(t-1,0),label='h(t,0)-h(t-1,0)')
plt.legend()

ax = fig.add_subplot(513)
ax.plot(t,t*np.heaviside(t,0),label='t*h(t,0)')
plt.legend()

ax = fig.add_subplot(514)
ax.plot(t,t*np.heaviside(t-1,0),label='t*h(t-1,0)')
plt.legend()

ax = fig.add_subplot(515)
ax.plot(t,t*np.heaviside(t,0)-t*np.heaviside(t-1,0),label=r'$t\cdot h(t,0) - t\cdot h(t-1,0)$')
plt.legend()
import sympy as sp
x,mu,sigma = sp.symbols('x mu sigma')
x**2 + mu + sigma<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.22028985507246376, 'fraction_numerical': 0.05507246376811594, 'mean_word_length': 5.815789473684211, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '631350', 'license': 'MIT', 'n_tokens_mistral': 544, 'n_tokens_neox': 521, 'n_words': 68, 'path': 'python/matplotlib/Signals_N_System/heaviside.ipynb', 'repo_name': 'karng87/nasm_game', 'size': '1035'}