Iām using pandas IntervalIndex
to define bins for dataframes. Now Iād like to plot a histogram using plotly.py with the bin intervals for the x axis values. How can I convert easiest?
@fkromer Unfortunately you cannot use the intervals in a pd.IntervalIndex
as prescribed bins, to define a plotly Histogram, because for a Histogram
(with vertical bars) you can set either the number of bins, as
nbinsx
or the start
, and end
values, as well as the size
of bins.
For more Histrogram attributes run:
help(go.Histogram)
@empet Thx for the hint. The most easy way to get something toi work is by converting the pd.IntervalIndices
to strings with .astype(str)
.