I want to plot a pandas series like so:
s = pd.Series(
[1, 2, 3, 4, 5],
index=pd.TimedeltaIndex(
["0 days 00:30:00", "0 days 01:00:00", "0 days 01:30:00", "0 days 02:00:00", "0 days 02:30:00"],
dtype="timedelta64[ns]",
freq=None,
),
)
s.plot(yerr=s)
Without yerr=s the above works fine. When I pass in yerr=s I get:
...
16 @set_module('numpy')
17 def asarray(a, dtype=None, order=None):
18 """Convert the input to an array.
19
20 Parameters
(...)
83
84 """
---> 85 return array(a, dtype, copy=False, order=order)
ValueError: Could not convert object to NumPy timedelta
If we defined s without timedelta indices, it would work:
s = pd.Series(
[1, 2, 3, 4, 5],
index=[1, 2, 3, 4, 5]
)
What's going on here? How can I add the error bars to my line graph?

