0

Usar numpy

Intento hacer esto con la librerĂ­a numpy pero no se me activa https://sololearn.com/compiler-playground/coVprQ2kGi8t/?ref=app

13th Mar 2024, 6:18 PM
Jesus
1 Answer
+ 2
There are lots of mistakes. See my comments on the corrected code: import math import numpy def stats(x,y,z): a=[x,y,z] stat = {} # you named the dictionary like the function med = numpy.mean(a) stat.update({"media":med}) # media is not defined, you need to mark it as string var = numpy.var(a) # you forgot numpy stat.update({"varianza":var}) # see media std = numpy.std(a) # you forgot numpy stat.update({"dt":std}) # see media return stat x=float(input()) # must be a number y=float(input()) # must be a number z=float(input()) # must be a number listado = stats(x,y,z) print(listado)
13th Mar 2024, 6:43 PM
Lisa
Lisa - avatar