Python Forum
TypeError: can't multiply sequence by non-int of type 'complex'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError: can't multiply sequence by non-int of type 'complex'
#3
I guess Python will complain at another place, if your CPU survives this code.

n = n + g * 0.001 * np.exp( 1j * k * np.array(r(x,x0,y,y0)) ) / np.array(r(x,x0,y,y0)) * E0(x0,y0)
This code is very inefficient. Try to replace map and lambda in the r function with numpy functions.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
RE: TypeError: can't multiply sequence by non-int of type 'complex' - by DeaD_EyE - Jul-12-2018, 11:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  TypeError: unsupported operand type(s) for /: 'str' and 'int' enderfran2006 1 2,811 Oct-01-2020, 09:41 AM
Last Post: buran
  TypeError: can't multiply sequence by non-int of type 'str' rmpadilla73 4 30,639 May-28-2018, 12:21 AM
Last Post: py_learner
  TypeError: can't multiply sequence by non-int of type 'str' Beatenberg 12 14,022 Oct-10-2017, 10:14 PM
Last Post: Beatenberg
  python!TypeError: can't multiply sequence by non-int of type 'float' shaywune 2 9,689 Sep-24-2016, 04:33 PM
Last Post: shaywune

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020