【发布时间】:2021-08-19 07:55:02
【问题描述】:
我有一个数据框,其中包含某些请求的前 10 个 Google 搜索结果。
我在图表上显示这些数据。根据轴 X,我有域,根据轴 Y,它们的位置。
问题是同一域的多个页面可以同时进入前10,这就是为什么在X轴上出现重复,在图表上没有显示。
问题: 是否有可能绕过这一点并仍然显示所有域,即使它们是重复的?
图表代码:
serp_csv2 = pd.read_csv('all.csv')
rent_serp = serp_csv2[serp_csv2['searchTerms'].str.contains("аренда", regex=True, case=False)]
rent_serp['bubble_size'] = 35
rent_serp.set_index("queryTime", inplace=True)
fig = px.scatter(rent_serp, x="displayLink", y="rank", animation_frame=rent_serp.index, animation_group="displayLink",
color="displayLink", hover_name="link", hover_data=["title"],
log_y=False,
height=710, width=900, range_x=[-1,11], range_y=[1,11], size="bubble_size", text="displayLink", template="plotly_dark", title="Heartbeat of SERP for 'аренда квартир киев'", labels={"rank":"Rankings","displayLink":"Domain Names"})
fig.layout.updatemenus[0].buttons[0].args[1]["frame"]["duration"] = 450
fig.layout.updatemenus[0].buttons[0].args[1]["transition"]["duration"] = 1500
fig.update_xaxes(
title_font = {"size": 20},
title_standoff = 45)
fig.update_yaxes(
title_font = {"size": 20},
title_standoff = 45)
fig.show(renderer='notebook')
【问题讨论】:
-
请不要提供数据样本作为截图。没有多少人会对手动输入数据感兴趣以帮助您。您可以轻松分享您的数据样本like this
标签: python plotly scatter-plot