Python Plotly Express中出现的额外未知行

Python Plotly Express中出现的额外未知行,python,pandas,plotly,Python,Pandas,Plotly,我目前正在使用plotly express生成一个折线图,这是我使用的代码 fig = px.line(run, x="day", y= 'infected', title= 'Mass Testing at 60% Simulations') fig.update_layout( xaxis_title="Day", yaxis_title= measure.capitalize(), legend_title = 'Quarantine Delay (Days)'

我目前正在使用plotly express生成一个折线图,这是我使用的代码

fig = px.line(run, x="day", y= 'infected', title= 'Mass Testing at 60% Simulations')


fig.update_layout(
    xaxis_title="Day",
    yaxis_title= measure.capitalize(),
    legend_title = 'Quarantine Delay (Days)',
    title={
        'y':0.9,
        'x':0.5,
        'xanchor': 'center',
        'yanchor': 'top'}
)

py.plot(fig, filename= name + '.html')
这就是数据集的外观:

它有两组正在比较的天数。绘图生成我想要的线条,但由于某种原因,第三条线条出现时,该线条没有任何悬停细节(在这张图片上以黄色突出显示)


我不太确定问题出在哪里,我仔细检查了数据集,只需要比较两组天数,但不知何故,这第三行正在生成。

这是您的“天数”列-您可以通过它是线性的这一事实来猜测

奇怪的是,确实如此。我尝试将日期转换为字符串,称之为“day 0”等等,但出于某种原因,它仍然会生成数天的行。这是否回答了您的问题?