25 views
Problem: I'm trying to run a code: f=np.loadtxt('Single Small Angle 1.txt',unpack=True,skiprows=2) g=np.loadtxt('Single Small Angle 5.txt',unpack=True,skiprows=2) x = f-g[:,:11944] t=range(len(x)) m=math.log10(abs(x)) np.polyfit(t,m)plt.plot(t,abs(x)) plt.show() m=math.log10(abs(x)) TypeError: only length-1 arrays can be converted to Python scalars. I'm just not sure how to fix my problem.

asked
Nov 5, 2020
Han Li
710 points