• Register

Zakaj mi pri izdelavi kazalnika izpiše: object of type <class 'float'> cannot be safely interpreted as an integer.

+4 votes
76 views
Uporabljena koda:

import ipywidgets as ipy

def izris (c):
    x=np.linspace(0,100,c)
    y= -0.5*np.sin(x/2)
    plt.plot(x,y)

ab = ipy.FloatSlider(value=1, min=0, max= 50, step=1)
ipy.interact(izris, c=ab)
asked May 30 by jakaribic (210 points)

1 Answer

0 votes
Opis napake vam pove veliko. Poskusite linspace uporabiti s c=3.2 npr...
answered May 30 by janko.slavic (74,450 points)
...