Python Forum
TypeError: _linspace_dispatcher() missing 1 required positional argument: 'stop'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError: _linspace_dispatcher() missing 1 required positional argument: 'stop'
#1
I'm triying to make a double reimann sum, with a limit b = (x^2 + y^2 = 16), the problem is when I use Sympy and marks as a TypeError in the linespace column, I tried to def the ecuation but nothing works, I'm doing somethin wrong or should I change something?
import numpy as np
import matplotlib.pyplot as plt
import sympy

#  function to integrate = x +3*y + 1
# Limit funtion 'b' =(x^2 + y^2 = 16)
Width=15; Length=20;

x = sympy.Symbol('x')
a = 0
b =(sympy.sqrt(16-x**2))
c = 0
d = 3
#Heigth of x
deltax= (b - a) / Width
#Heigth of y
deltay = (d - c) / Length


#Area of each square
dA = deltax * deltay


x = np.linspace((a, b - deltax, Ancho));
y = np.linspace((c, d - deltay, Largo));


f = lambda x,y: x +3*y + 1

[X, Y] = np.meshgrid(x, y);
#reimann sum
Suma=sum(dA * f(X, Y))
Suma = sum(Suma)

int(Suma)

print(Suma)

Error:
File "<__array_function__ internals>", line 4, in linspace TypeError: _linspace_dispatcher() missing 1 required positional argument: 'stop'
Reply
#2
Ancho, Largo Not defined
Reply
#3
Sorry it was a typo error, but my code stills send the same error Ancho = Width and Largo = Length **
Reply
#4
linspace syntax:
numpy.linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None, axis=0)

why double parenthesis, whole command?
unlikely a cuase, but add parenthesis around b - deltax and d - deltay
also, just before command, print out values of b - deltax and d - deltay
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  TypeError: a bytes-like object is required ZeroX 13 3,834 Jan-07-2023, 07:02 PM
Last Post: deanhystad
  Error TypeError: output_type_handler() takes 2 positional arguments but 6 were given paulo79 1 1,857 Oct-17-2022, 06:29 PM
Last Post: paulo79
  TypeError: a bytes-like object is required, not 'str' - Help Please. IanJ 3 4,670 Aug-29-2022, 05:53 PM
Last Post: deanhystad
  TypeError: float() argument must be a string or a number, not 'list' Anldra12 2 4,757 Jul-01-2022, 01:23 PM
Last Post: deanhystad
  Error: _vhstack_dispatcher() takes 1 positional argument but 9 were given alexfrol86 3 5,713 May-09-2022, 12:49 PM
Last Post: deanhystad
  What is positional argument self? Frankduc 22 5,490 Mar-06-2022, 01:18 AM
Last Post: Frankduc
  TypeError: missing a required argument: 'y' gible 0 2,843 Dec-15-2021, 02:21 AM
Last Post: gible
  positional argument: 'self' mcmxl22 8 3,194 Dec-13-2021, 10:11 PM
Last Post: deanhystad
  TypeError: missing 3 required positional arguments: wardancer84 9 10,660 Aug-19-2021, 04:27 PM
Last Post: deanhystad
  TypeError: run_oracle_job() missing 1 required positional argument: 'connection_strin python_student 1 1,937 Aug-06-2021, 08:05 PM
Last Post: SheeppOSU

Forum Jump:

User Panel Messages

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