DataFrame.iplot doesn't work with TimeDeltaIndex


I noticed that DataFrame.iplot doesn’t work with TimeDeltaIndex.

Here is code

import pandas as pd
pd.set_option("max_rows", 10)  # affichage limité à 10 lignes

# import plotly.plotly as py
# import plotly.graph_objs as go
from plotly.offline import iplot, init_notebook_mode

import cufflinks as cf

N = 3
rng = pd.timedelta_range(start="0h", freq="15min", periods=3)
df = pd.DataFrame({"a": [1,2,3], "b": [1,3,2], "c": [4,5,6]}, index=rng)
# df.index = df.index.total_seconds() / 60  # convert TimeDelta to minutes

and a screenshot

You can notice that x-axis is not displayed correctly.

A workaround can be to convert to minutes using

df.index = df.index.total_seconds() / 60

or to Timestamp

df.index = df.index + pd.to_datetime(0)

Kind regards

Issue opened at issue,

Well done! I didn’t recall my own issue.

1 Like