0

I am trying to make an interactive chart with sliders to control date and time So I tried to do this

from ipywidgets import widgets, FloatSlider
import pandas as pd
from matplotlib import pyplot as plt

DateList = ['2013-01-01', '2013-01-02', '2013-01-03']
ts = pd.to_datetime(pd.Series(DateList))

Slider = FloatSlider(min=min(ts), max=max(ts), step=1, 
                 value=pd.Timestamp('2013-01-01'))

but this doesn't work? How can I do this?

Thomas K
  • 39,200
  • 7
  • 84
  • 86
KillerSnail
  • 3,321
  • 11
  • 46
  • 64
  • The 'float' in FloatSlider means a floating point number. I guess you'd need to make a separate `DatetimeSlider` class. – Thomas K Apr 28 '16 at 13:36
  • there is no DatetimeSlider class? – KillerSnail May 02 '16 at 01:30
  • No, there isn't. You'd need to [make one](https://ipywidgets.readthedocs.io/en/latest/examples/Custom%20Widget%20-%20Hello%20World.html) (actually, doing it with a calendar might be easier than trying to make a date slider). Or you could just use a slider with regular numbers and convert them to dates on the Python side. – Thomas K May 02 '16 at 19:40

0 Answers0