Jul-24-2020, 10:47 AM
(This post was last modified: Jul-24-2020, 10:47 AM by cokhuatlanyeuthuongconhetmuc.)
import math import numpy as np from matplotlib import pyplot as plt import pandas as pd def fx(R, alpha): x = R*math.cos(alpha) y = R*math.sin(alpha) return x,y alpha = np.linspace(0, math.pi*2, num = 10000) Rmax = 100000 for i in range(alpha): (x[i], y[i]) = fx(Rmax, alpha[i])
Error:TypeError Traceback (most recent call last)
<ipython-input-14-8444e88ffbda> in <module>
2 alpha = np.linspace(0, math.pi*2, num = 10000)
3 Rmax = 100000
----> 4 for i in range(alpha):
5 (x[i], y[i]) = fx(Rmax, alpha[i])
6
TypeError: only integer scalar arrays can be converted to a scalar index
Here is my code and error.