Nov-04-2019, 03:55 PM
(This post was last modified: Nov-04-2019, 11:44 PM by scidam. Edited 1 time in total.)

Can anyone make a look to following code why it cant calculate complex numbers in the defined arrray.

Please post all code, output and errors (in it's entirety) between their respective tags. I did it for you this time, Here are instructions on how to do it yourself next time.

import numpy as np n=5 alpha = 0.7 A=np.zeros([n+1,n+1]) B=np.zeros([n+1]) #sum=0 for i in range(n+1): for j in range(n+1): A[i][j]=(i-j)**(alpha) print(A)---------------------------------------------------------------------------

```
Error:
TypeError Traceback (most recent call last)
<ipython-input-20-265607fc02b7> in <module>
8 for i in range(n+1):
9 for j in range(n+1):
---> 10 A[i][j]=(i-j)**(alpha)
11
12
TypeError: can't convert complex to float
```

**scidam**wrote Nov-04-2019, 11:44 PM:Please post all code, output and errors (in it's entirety) between their respective tags. I did it for you this time, Here are instructions on how to do it yourself next time.