Reputation: 1241
1 def auto_correlate(x):
2 cor = np.correlate(x,x,mode="full")
3 return cor[N-1:]
4 c = np.zeros(N)
5 c = auto_correlate(x-ave)/N
6 plt.plot(c)
7 plt.xlim(-1000, 10000)
8 plt.xlabel(r'$i$',fontsize=16)
9 plt.ylabel(r'$\varphi(i)$',fontsize=16)
10 print('\sigma^2 = ', std**2)
11 plt.show()
Why do I keep getting error 'tuple' object not callable online 7 ? please explain
Upvotes: 10
Views: 20208
Reputation: 34
This was a strange error that took my time for an hour.
Finally, I found out that in the previous cell I used plt.xlim
with '='
sign, in the wrong cell I hadn't got an error but it shows itself in the next cell.
Upvotes: -1
Reputation: 1
Correct Code which I tried. plt.figure( figsize=(14, 14))
Restart the kernel and error will go. Even if you load the dataframe you will get the same error.
TypeError Traceback (most recent call last) in ----> 1 plt.figure( figsize=(2, 5))
Upvotes: 0
Reputation: 1428
It looks like you may have overwritten the plt.xlim function.
Did you perhaps run plt.xlim=(-1000, 10000)
? (note the "=")
type plt.xlim
and run it to check.
Output should be something like:
<function matplotlib.pyplot.xlim(*args, **kwargs)>
Upvotes: 20