Basic sampling excercise - unsure of rationale informing np.arange parameters for time array
The Hz values are used to get your parameters for defining your signal.

I don't think there is any reason that they went from -1 to 1 instead of, say, 0 to 2.  Notice that the end point is not included in the range.

The spacing in your sampling is 1/100 of a second.  Yes, the array is giving you values on a time scale.

To generated the signal your are going to need:


f = 2
signal = np.sin( f * 2*np.pi * t )


The $2\pi$ comes as a unit conversion of radians per cycle.  Therefore the argument, in units is:

$$ \frac{cycles}{second} \cdot \frac{radians}{cycle} \cdot seconds = radians $$

Hope this helps.

Ced

================================

Followup:

Here is a sample program.


import numpy as np
import matplotlib.pyplot as plt

f = 2.0
fs = 100.0

t = np.arange( -1.0, 1.0+1.0/fs, 1.0/fs )
signal = np.sin( f * 2*np.pi * t )

plt.plot(t, signal, c='g')
plt.show()


Notice that I added a bunch of ".0"s to force Python into using floats.  Without it, the program passed 1/fs as the integer 0 to arange.