When creating a sunburst chart I want to have a timedelta sum values seen when moving cursor into a part of chart (field 'time' below). Field is type timedelta64[ns]. Works fine with sum aggregations with pandas groupby function. Then I have values like this: 13 days 12:34:15
When I create a plotly sunburst chart and take my cursor over the field I see a scientific notations as below: time_sum: 1.512195e+15
Is there a way to change it? Is there a way to see this 'time' field as a timedelta sum?
Not sure if it's important but I am using Jupyter Notebook.
Example code here:
import plotly.express as px
import pandas as pd
df = pd.DataFrame([
['A', 'aa', 'x', 46789],
['B', 'aa', 'x', 899],
['C', 'aa', 'x', 47],
['A', 'aa', 'y', 1034],
['A', 'aa', 'y', 9899],
['A', 'ab', 'x', 34676],
['B', 'ba', 'y', 654],
['B', 'ba', 'x', 321442]],
index=[1, 2, 3, 4, 5, 6, 7, 8],
columns=['category','subcategory','type', 'time'])
df['time'] = pd.to_timedelta(df['time'], unit = 'S')
fig = px.sunburst(df, path = ['category', 'subcategory', 'type'], values = 'time',
width = 700, height = 700)
fig.show()
