import numpy as np
import matplotlib.pyplot as plt
import IPython.display as ipd
## Generate 100 samples, equally spaced, starting at 0 and ending at 1
x = np.arange(100)/99
plt.plot(x)
[<matplotlib.lines.Line2D at 0x7ff51c88dbb0>]
print(x[0])
print(x[-1])
0.0 1.0
x = np.linspace(0, 1, 100)
plt.plot(x)
print(x[0])
print(x[-1])
0.0 1.0
## Ex) Take 32 equally spaced samples between -np.pi and np.pi
x = np.linspace(-np.pi, np.pi, 32)
plt.stem(x)
<StemContainer object of 3 artists>