I want to plot this exponential function:
T = np.random.exponential(3,50) as a function of time (Minutes 1-15) t = np.arange(0,15,1).
I get: x and y must have same first dimension...
Could you explain how it can be done properly? I'd like to understand.
Tis not a function, it's an array. You must ensure thattandThave the same shape.You should pass a
sizethat is the same as the length ofttonp.random.exponential:Note that since
Tis random, there is no direct relationship betweentandT.Output:
Conversely, to scape
tfromT's shape, usenp.linspace:Output: